diff options
| author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-09-07 18:58:01 +0000 |
|---|---|---|
| committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2008-09-07 18:58:01 +0000 |
| commit | dee8291a14f9e7e95c02b7eb25fa52e82e55284c (patch) | |
| tree | ae8b59335378a701ba1d3034490c9fd27be88fed /clang | |
| parent | b0920374cab6c6d4cfc5b768d8754af0c57809de (diff) | |
| download | bcm5719-llvm-dee8291a14f9e7e95c02b7eb25fa52e82e55284c.tar.gz bcm5719-llvm-dee8291a14f9e7e95c02b7eb25fa52e82e55284c.zip | |
Support C++'s declaration-statement.
llvm-svn: 55888
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Parse/ParseStmt.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseStmt.cpp b/clang/lib/Parse/ParseStmt.cpp index e20e056ebdb..5b2d3a3e0f3 100644 --- a/clang/lib/Parse/ParseStmt.cpp +++ b/clang/lib/Parse/ParseStmt.cpp @@ -35,6 +35,7 @@ using namespace clang; /// 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 @@ Parser::StmtResult Parser::ParseStatementOrDeclaration(bool OnlyStatement) { // 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. |

