diff options
author | John McCall <rjmccall@apple.com> | 2009-12-19 09:28:58 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-12-19 09:28:58 +0000 |
commit | 1f4ee7bd2f4105a04811a06294e4654c6e4058c4 (patch) | |
tree | 1fef3d651a963463bac8e563ef1dcb8a7e9eeddc /clang/lib/Parse/ParseDecl.cpp | |
parent | 4f469974b27e0da7768b1eb30078658f1f382a72 (diff) | |
download | bcm5719-llvm-1f4ee7bd2f4105a04811a06294e4654c6e4058c4.tar.gz bcm5719-llvm-1f4ee7bd2f4105a04811a06294e4654c6e4058c4.zip |
Just push a new scope when parsing an out-of-line variable definition.
Magically fixes all the terrible lookup problems associated with not pushing
a new scope. Resolves an ancient xfail and an LLVM misparse.
llvm-svn: 91769
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 5dd78f7b547..43c92456d29 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -550,13 +550,17 @@ Parser::DeclPtrTy Parser::ParseDeclarationAfterDeclarator(Declarator &D, SourceLocation DelLoc = ConsumeToken(); Actions.SetDeclDeleted(ThisDecl, DelLoc); } else { - if (getLang().CPlusPlus) + if (getLang().CPlusPlus && D.getCXXScopeSpec().isSet()) { + EnterScope(0); Actions.ActOnCXXEnterDeclInitializer(CurScope, ThisDecl); + } OwningExprResult Init(ParseInitializer()); - if (getLang().CPlusPlus) + if (getLang().CPlusPlus && D.getCXXScopeSpec().isSet()) { Actions.ActOnCXXExitDeclInitializer(CurScope, ThisDecl); + ExitScope(); + } if (Init.isInvalid()) { SkipUntil(tok::semi, true, true); |