-Wunused-variable triggers for temporaries with side effects when bound to a reference #54489
Labels
clang:diagnostics
New/improved warning or error message in Clang, but not in clang-tidy or static analyzer
The following code warns on
guard2
andguard3
(but not guard) despite all 3 variable having side effects on destruction.This feels inconsistent and surprising.
GCC emits no warning in any of these cases.
https://godbolt.org/z/zr7dsevoc
The text was updated successfully, but these errors were encountered: