]> granicus.if.org Git - clang/commitdiff
Make the invalid declarator recovery when parsing members work the same as when parsi...
authorSebastian Redl <sebastian.redl@getdesigned.at>
Sun, 24 Apr 2011 16:27:48 +0000 (16:27 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Sun, 24 Apr 2011 16:27:48 +0000 (16:27 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130101 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDeclCXX.cpp
test/SemaTemplate/deduction-crash.cpp
test/SemaTemplate/explicit-instantiation.cpp

index 119bf0f762bfac010a31b58ca64cbcd975be92f1..f59302868b57013163074774bc6098ec1fa08c04 100644 (file)
@@ -1551,7 +1551,7 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
     // Error parsing the declarator?
     if (!DeclaratorInfo.hasName()) {
       // If so, skip until the semi-colon or a }.
-      SkipUntil(tok::r_brace, true);
+      SkipUntil(tok::r_brace, true, true);
       if (Tok.is(tok::semi))
         ConsumeToken();
       return;
index 1860c7577c79fe7fce5101c3d13a41495cc5fff3..8a15605734c78089d22f0ffb3d9cf984b2875ec9 100644 (file)
@@ -4,7 +4,7 @@
 
 // Note that the error count below doesn't matter. We just want to
 // make sure that the parser doesn't crash.
-// CHECK: 16 errors
+// CHECK: 14 errors
 template<a>
 struct int_;
 
index ffec3c2b97f0170b8e0ebdf995bdb3c072714d2a..63016fd71568cec2a69ba48f11a8f961da1f4006 100644 (file)
@@ -88,15 +88,12 @@ template<typename> struct X3 { };
 inline template struct X3<int>; // expected-warning{{ignoring 'inline' keyword on explicit template instantiation}}
 static template struct X3<float>; // expected-warning{{ignoring 'static' keyword on explicit template instantiation}}
 
-namespace PR7622 { // expected-note{{to match this}}
+namespace PR7622 {
   template<typename,typename=int>
   struct basic_streambuf;
 
-  // FIXME: Very poor recovery here.
   template<typename,typename>
   struct basic_streambuf{friend bob<>()}; // expected-error{{unknown type name 'bob'}} \
   // expected-error{{ expected member name or ';' after declaration specifiers}}
-  template struct basic_streambuf<int>; // expected-error{{explicit instantiation of 'basic_streambuf' in class scope}}
-}  // expected-error{{expected ';' after struct}}
-  
-//expected-error{{expected '}'}}
+  template struct basic_streambuf<int>;
+}