diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-28 20:42:35 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-09-28 20:42:35 +0000 |
| commit | 1db5c941ad02d7aabd729d2a158a0f9550b77718 (patch) | |
| tree | d12b2cd88fed61205fd095b99b9f9e4f59386cdd /clang/lib/Parse/ParseDecl.cpp | |
| parent | 1b35f4cc66debe68571216ca35672b021ea9baa7 (diff) | |
| download | bcm5719-llvm-1db5c941ad02d7aabd729d2a158a0f9550b77718.tar.gz bcm5719-llvm-1db5c941ad02d7aabd729d2a158a0f9550b77718.zip | |
vla expressions used in __typeof__ must be evaluated.
Fixes rdar://8476159.
llvm-svn: 114982
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
| -rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 5ed22e27537..0a48d4d5507 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -320,7 +320,8 @@ AttributeList* Parser::ParseBorlandTypeAttributes(AttributeList *CurrAttr) { /// [C++0x] static_assert-declaration /// others... [FIXME] /// -Parser::DeclGroupPtrTy Parser::ParseDeclaration(unsigned Context, +Parser::DeclGroupPtrTy Parser::ParseDeclaration(StmtVector &Stmts, + unsigned Context, SourceLocation &DeclEnd, CXX0XAttributeList Attr) { ParenBraceBracketBalancer BalancerRAIIObj(*this); @@ -344,7 +345,8 @@ Parser::DeclGroupPtrTy Parser::ParseDeclaration(unsigned Context, SingleDecl = ParseNamespace(Context, DeclEnd, InlineLoc); break; } - return ParseSimpleDeclaration(Context, DeclEnd, Attr.AttrList, true); + return ParseSimpleDeclaration(Stmts, Context, DeclEnd, Attr.AttrList, + true); case tok::kw_namespace: if (Attr.HasAttr) Diag(Attr.Range.getBegin(), diag::err_attributes_not_allowed) @@ -361,7 +363,8 @@ Parser::DeclGroupPtrTy Parser::ParseDeclaration(unsigned Context, SingleDecl = ParseStaticAssertDeclaration(DeclEnd); break; default: - return ParseSimpleDeclaration(Context, DeclEnd, Attr.AttrList, true); + return ParseSimpleDeclaration(Stmts, Context, DeclEnd, Attr.AttrList, + true); } // This routine returns a DeclGroup, if the thing we parsed only contains a @@ -376,7 +379,8 @@ Parser::DeclGroupPtrTy Parser::ParseDeclaration(unsigned Context, /// /// If RequireSemi is false, this does not check for a ';' at the end of the /// declaration. If it is true, it checks for and eats it. -Parser::DeclGroupPtrTy Parser::ParseSimpleDeclaration(unsigned Context, +Parser::DeclGroupPtrTy Parser::ParseSimpleDeclaration(StmtVector &Stmts, + unsigned Context, SourceLocation &DeclEnd, AttributeList *Attr, bool RequireSemi) { @@ -386,6 +390,9 @@ Parser::DeclGroupPtrTy Parser::ParseSimpleDeclaration(unsigned Context, DS.AddAttributes(Attr); ParseDeclarationSpecifiers(DS, ParsedTemplateInfo(), AS_none, getDeclSpecContextFromDeclaratorContext(Context)); + StmtResult R = Actions.ActOnVlaStmt(DS); + if (R.isUsable()) + Stmts.push_back(R.release()); // C99 6.7.2.3p6: Handle "struct-or-union identifier;", "enum { X };" // declaration-specifiers init-declarator-list[opt] ';' |

