diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2012-11-30 23:09:29 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2012-11-30 23:09:29 +0000 |
| commit | 5ac98751602bb2c192c17d4742f4abeec82ee356 (patch) | |
| tree | be7b1923135afc33d3203769518e59d3c3bc1012 /clang/test/SemaCXX/compare.cpp | |
| parent | 414abc471cf178a54ba2135e935bdee5ba76409d (diff) | |
| download | bcm5719-llvm-5ac98751602bb2c192c17d4742f4abeec82ee356.tar.gz bcm5719-llvm-5ac98751602bb2c192c17d4742f4abeec82ee356.zip | |
Make -Wtautological-constant-out-of-range-compare behave sanely for enums with a signed fixed type.
<rdar://problem/12780159>.
llvm-svn: 169051
Diffstat (limited to 'clang/test/SemaCXX/compare.cpp')
| -rw-r--r-- | clang/test/SemaCXX/compare.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/compare.cpp b/clang/test/SemaCXX/compare.cpp index c76efe92baf..5771912590c 100644 --- a/clang/test/SemaCXX/compare.cpp +++ b/clang/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); +} |

