diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/FixIt/fixit-cxx0x.cpp | 14 | ||||
-rw-r--r-- | clang/test/FixIt/fixit.c | 8 | ||||
-rw-r--r-- | clang/test/Parser/cxx0x-ambig.cpp | 2 |
3 files changed, 23 insertions, 1 deletions
diff --git a/clang/test/FixIt/fixit-cxx0x.cpp b/clang/test/FixIt/fixit-cxx0x.cpp index b6cc2c08b03..0c837b4beb0 100644 --- a/clang/test/FixIt/fixit-cxx0x.cpp +++ b/clang/test/FixIt/fixit-cxx0x.cpp @@ -108,3 +108,17 @@ void func(); template<int *ip> struct IP { }; // expected-note{{declared here}} IP<0> ip0; // expected-error{{null non-type template argument must be cast to template parameter type 'int *'}} +namespace MissingSemi { + struct a // expected-error {{expected ';' after struct}} + struct b // expected-error {{expected ';' after struct}} + enum x : int { x1, x2, x3 } // expected-error {{expected ';' after enum}} + struct c // expected-error {{expected ';' after struct}} + enum x : int // expected-error {{expected ';' after enum}} + // FIXME: The following gives a poor diagnostic (we parse the 'int' and the + // 'struct' as part of the same enum-base. + // enum x : int + // struct y + namespace N { + struct d // expected-error {{expected ';' after struct}} + } +} diff --git a/clang/test/FixIt/fixit.c b/clang/test/FixIt/fixit.c index 5e4947b8cdd..ce6f1092df1 100644 --- a/clang/test/FixIt/fixit.c +++ b/clang/test/FixIt/fixit.c @@ -100,3 +100,11 @@ int noSemiAfterLabel(int n) { } return 1; } + +struct noSemiAfterStruct // expected-error {{expected ';' after struct}} +struct noSemiAfterStruct { + int n // expected-warning {{';'}} +} // expected-error {{expected ';' after struct}} +enum noSemiAfterEnum { + e1 +} // expected-error {{expected ';' after enum}} diff --git a/clang/test/Parser/cxx0x-ambig.cpp b/clang/test/Parser/cxx0x-ambig.cpp index 98757b48c71..e1e6ff76ad8 100644 --- a/clang/test/Parser/cxx0x-ambig.cpp +++ b/clang/test/Parser/cxx0x-ambig.cpp @@ -57,7 +57,7 @@ namespace bitfield { // This could be a bit-field, but would be ill-formed due to the anonymous // member being initialized. struct S5 { - enum E : int { a = 1 } { b = 2 }; // expected-error {{expected member name}} + enum E : int { a = 1 } { b = 2 }; // expected-error {{expected ';' after enum}} expected-error {{expected member name}} }; // This could be a bit-field. struct S6 { |