diff options
Diffstat (limited to 'test/SemaCXX/warn-unused-value.cpp')
-rw-r--r-- | test/SemaCXX/warn-unused-value.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/SemaCXX/warn-unused-value.cpp b/test/SemaCXX/warn-unused-value.cpp index 775c3cf01f243..80298ec6664a8 100644 --- a/test/SemaCXX/warn-unused-value.cpp +++ b/test/SemaCXX/warn-unused-value.cpp @@ -15,3 +15,18 @@ namespace test0 { box->j; } } + +namespace test1 { +struct Foo { + int i; + bool operator==(const Foo& rhs) { + return i == rhs.i; + } +}; + +#define NOP(x) (x) +void b(Foo f1, Foo f2) { + NOP(f1 == f2); // expected-warning {{expression result unused}} +} +#undef NOP +} |