summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp8
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);
OpenPOWER on IntegriCloud