1 // RUN: %clang_cc1 -fblocks -fsyntax-only -Wunused-but-set-variable -verify %s
7 struct __attribute__((warn_unused
)) SWarnUnused
{
14 int y
; // expected-warning{{variable 'y' set but not used}}
17 int z
__attribute__((unused
));
20 // In C++, don't warn for structs. (following gcc's behavior)
25 // Unless it's marked with the warn_unused attribute.
26 struct SWarnUnused swu
; // expected-warning{{variable 'swu' set but not used}}
27 struct SWarnUnused swu2
;
37 int y
; // expected-warning{{variable 'y' set but not used}}
47 // Don't warn for either of these cases.
55 // Don't warn for overloaded compound assignment operators.
60 template<typename T
> void f4(T n
) {
61 // Don't warn for (potentially) overloaded compound assignment operators in
67 template <typename T
> void f5() {
68 // Don't warn for overloaded pre/post operators in template code.