summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/compare.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/SemaCXX/compare.cpp')
-rw-r--r--clang/test/SemaCXX/compare.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/compare.cpp b/clang/test/SemaCXX/compare.cpp
index 05980baf6d6..c76efe92baf 100644
--- a/clang/test/SemaCXX/compare.cpp
+++ b/clang/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);
+}
OpenPOWER on IntegriCloud