[cfe-commits] r55888 - /cfe/trunk/lib/Parse/ParseStmt.cpp

Argiris Kirtzidis akyrtzi at gmail.com
Sun Sep 7 11:58:02 PDT 2008


Author: akirtzidis
Date: Sun Sep  7 13:58:01 2008
New Revision: 55888

URL: http://llvm.org/viewvc/llvm-project?rev=55888&view=rev
Log:
Support C++'s declaration-statement.

Modified:
    cfe/trunk/lib/Parse/ParseStmt.cpp

Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=55888&r1=55887&r2=55888&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Sun Sep  7 13:58:01 2008
@@ -35,6 +35,7 @@
 ///         selection-statement
 ///         iteration-statement
 ///         jump-statement
+/// [C++]   declaration-statement
 /// [OBC]   objc-throw-statement
 /// [OBC]   objc-try-catch-statement
 /// [OBC]   objc-synchronized-statement
@@ -93,7 +94,7 @@
     // PASS THROUGH.
 
   default:
-    if (!OnlyStatement && isDeclarationSpecifier()) {
+    if ((getLang().CPlusPlus || !OnlyStatement) && isDeclarationSpecifier()) {
       SourceLocation DeclStart = Tok.getLocation();
       DeclTy *Res = ParseDeclaration(Declarator::BlockContext);
       // FIXME: Pass in the right location for the end of the declstmt.





More information about the cfe-commits mailing list