diff options
Diffstat (limited to 'test/SemaCXX/compare.cpp')
-rw-r--r-- | test/SemaCXX/compare.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/SemaCXX/compare.cpp b/test/SemaCXX/compare.cpp index 05980baf6d..c76efe92ba 100644 --- a/test/SemaCXX/compare.cpp +++ b/test/SemaCXX/compare.cpp @@ -338,3 +338,13 @@ void test7(unsigned long other) { (void)((unsigned char)other != (unsigned short)(0x100)); // expected-warning{{true}} (void)((unsigned short)other != (unsigned char)(0xff)); } + +void test8(int x) { + enum E { + Negative = -1, + Positive = 1 + }; + + (void)((E)x == 1); + (void)((E)x == -1); +} |