aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/compare.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-11-30 23:09:29 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-11-30 23:09:29 +0000
commitd87de7bdbc25dd84ae3dbefffda4539c443000d2 (patch)
tree92ed861701bee1b15db0bd539a29ce13057c9404 /test/SemaCXX/compare.cpp
parent4565e487531c7bf6d348dbe9f5529784966fc7ae (diff)
Make -Wtautological-constant-out-of-range-compare behave sanely for enums with a signed fixed type.
<rdar://problem/12780159>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169051 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaCXX/compare.cpp')
-rw-r--r--test/SemaCXX/compare.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/SemaCXX/compare.cpp b/test/SemaCXX/compare.cpp
index c76efe92ba..5771912590 100644
--- a/test/SemaCXX/compare.cpp
+++ b/test/SemaCXX/compare.cpp
@@ -1,7 +1,7 @@
// Force x86-64 because some of our heuristics are actually based
// on integer sizes.
-// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare %s
+// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -pedantic -verify -Wsign-compare -std=c++11 %s
int test0(long a, unsigned long b) {
enum EnumA {A};
@@ -348,3 +348,10 @@ void test8(int x) {
(void)((E)x == 1);
(void)((E)x == -1);
}
+
+void test9(int x) {
+ enum E : int {
+ Positive = 1
+ };
+ (void)((E)x == 1);
+}