1 // RUN: %clang_cc1 -fblocks -fsyntax-only -Wunused-but-set-variable -verify %s
7 struct __attribute__((warn_unused
)) SWarnUnused
{
13 int y
; // expected-warning{{variable 'y' set but not used}}
16 int z
__attribute__((unused
));
19 // In C++, don't warn for structs. (following gcc's behavior)
24 // Unless it's marked with the warn_unused attribute.
25 struct SWarnUnused swu
; // expected-warning{{variable 'swu' set but not used}}
26 struct SWarnUnused swu2
;
36 int y
; // expected-warning{{variable 'y' set but not used}}
46 // Don't warn for either of these cases.
54 // Don't warn for overloaded compound assignment operators.
59 template<typename T
> void f4(T n
) {
60 // Don't warn for (potentially) overloaded compound assignment operators in