diff options
Diffstat (limited to 'test/SemaCXX/expressions.cpp')
-rw-r--r-- | test/SemaCXX/expressions.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/SemaCXX/expressions.cpp b/test/SemaCXX/expressions.cpp index 2635fb8..1a50c99 100644 --- a/test/SemaCXX/expressions.cpp +++ b/test/SemaCXX/expressions.cpp @@ -118,3 +118,20 @@ void test3() { (void)s1.foo(); (void)s2.foo(); } + +namespace pr16992 { + typedef int T; + unsigned getsz() { + return (sizeof T()); + } +} + +void test4() { + #define X 0 + #define Y 1 + bool r1 = X || Y; + + #define Y2 2 + bool r2 = X || Y2; // expected-warning {{use of logical '||' with constant operand}} \ + // expected-note {{use '|' for a bitwise operation}} +} |