[llvm-branch-commits] [cfe-branch] r105046 - /cfe/branches/Apple/whitney/lib/Parse/ParseDeclCXX.cpp

Daniel Dunbar daniel at zuster.org
Fri May 28 16:07:12 PDT 2010


Author: ddunbar
Date: Fri May 28 18:07:12 2010
New Revision: 105046

URL: http://llvm.org/viewvc/llvm-project?rev=105046&view=rev
Log:
Merge r104940:
--
Author: John McCall <rjmccall at apple.com>
Date:   Fri May 28 08:11:17 2010 +0000

    Don't just skip over the entire tag definition if the parser action didn't
    give us a decl back.  Makes -cc1 -parse-noop handle a substantially larger
    amount of the C++ grammar.

Modified:
    cfe/branches/Apple/whitney/lib/Parse/ParseDeclCXX.cpp

Modified: cfe/branches/Apple/whitney/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/Apple/whitney/lib/Parse/ParseDeclCXX.cpp?rev=105046&r1=105045&r2=105046&view=diff
==============================================================================
--- cfe/branches/Apple/whitney/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/branches/Apple/whitney/lib/Parse/ParseDeclCXX.cpp Fri May 28 18:07:12 2010
@@ -1544,12 +1544,8 @@
 
   SourceLocation LBraceLoc = ConsumeBrace();
 
-  if (!TagDecl) {
-    SkipUntil(tok::r_brace, false, false);
-    return;
-  }
-
-  Actions.ActOnStartCXXMemberDeclarations(CurScope, TagDecl, LBraceLoc);
+  if (TagDecl)
+    Actions.ActOnStartCXXMemberDeclarations(CurScope, TagDecl, LBraceLoc);
 
   // C++ 11p3: Members of a class defined with the keyword class are private
   // by default. Members of a class defined with the keywords struct or union
@@ -1594,9 +1590,10 @@
   if (Tok.is(tok::kw___attribute))
     AttrList.reset(ParseGNUAttributes());
 
-  Actions.ActOnFinishCXXMemberSpecification(CurScope, RecordLoc, TagDecl,
-                                            LBraceLoc, RBraceLoc,
-                                            AttrList.get());
+  if (TagDecl)
+    Actions.ActOnFinishCXXMemberSpecification(CurScope, RecordLoc, TagDecl,
+                                              LBraceLoc, RBraceLoc,
+                                              AttrList.get());
 
   // C++ 9.2p2: Within the class member-specification, the class is regarded as
   // complete within function bodies, default arguments,
@@ -1613,7 +1610,8 @@
     ParseLexedMethodDefs(getCurrentClass());
   }
 
-  Actions.ActOnTagFinishDefinition(CurScope, TagDecl, RBraceLoc);
+  if (TagDecl)
+    Actions.ActOnTagFinishDefinition(CurScope, TagDecl, RBraceLoc);
 
   // Leave the class scope.
   ParsingDef.Pop();





More information about the llvm-branch-commits mailing list