diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-02-17 23:29:11 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-02-17 23:29:11 +0000 |
commit | 12ea0f4ef952d3e1ed5d264848969b353e834c0d (patch) | |
tree | 74a13ab5747451fd805c1ad7f1a47d6ee104c99a /clang/test/SemaCXX/condition.cpp | |
parent | 81001ab4901833c16f6e4ac5d19bd574478de171 (diff) | |
download | bcm5719-llvm-12ea0f4ef952d3e1ed5d264848969b353e834c0d.tar.gz bcm5719-llvm-12ea0f4ef952d3e1ed5d264848969b353e834c0d.zip |
For -Wswitch-enum warnings, be sure to look through typedefs of enum
types. Fixes <rdar://problem/7643909>.
llvm-svn: 96531
Diffstat (limited to 'clang/test/SemaCXX/condition.cpp')
-rw-r--r-- | clang/test/SemaCXX/condition.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/test/SemaCXX/condition.cpp b/clang/test/SemaCXX/condition.cpp index fe802d0555e..b3e862dc1b0 100644 --- a/clang/test/SemaCXX/condition.cpp +++ b/clang/test/SemaCXX/condition.cpp @@ -18,7 +18,8 @@ void test() { while (struct S {} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{no viable conversion}} expected-error {{value of type 'struct S' is not contextually convertible to 'bool'}} expected-note{{candidate constructor (the implicit copy constructor)}} while (struct {} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{no viable conversion}} expected-error {{value of type 'struct <anonymous>' is not contextually convertible to 'bool'}} expected-note{{candidate constructor (the implicit copy constructor)}} - switch (enum {E} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{cannot initialize}} + switch (enum {E} x=0) ; // expected-error {{types may not be defined in conditions}} expected-error {{cannot initialize}} \ + // expected-warning{{enumeration value 'E' not handled in switch}} if (int x=0) { // expected-note 2 {{previous definition is here}} int x; // expected-error {{redefinition of 'x'}} |