summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-12-11 20:04:54 +0000
committerJohn McCall <rjmccall@apple.com>2009-12-11 20:04:54 +0000
commit2b058ef245469d50005b44950dbc683cf12e86f7 (patch)
treea5edf8d9e60680e6cc1b418dcd83c256aee575ee /clang/lib/Parse/ParseDecl.cpp
parent6d306bb32b9eae05e51d8fcaa254949db715fafc (diff)
downloadbcm5719-llvm-2b058ef245469d50005b44950dbc683cf12e86f7.tar.gz
bcm5719-llvm-2b058ef245469d50005b44950dbc683cf12e86f7.zip
Don't enter a new scope for a namespace-qualified declarator unless we're
in a file context. In well-formed code, only happens with friend functions. Fixes PR 5760. llvm-svn: 91146
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index 2a6a0494e57..efac0c4a030 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -2335,9 +2335,10 @@ void Parser::ParseDirectDeclarator(Declarator &D) {
ParseOptionalCXXScopeSpecifier(D.getCXXScopeSpec(), /*ObjectType=*/0,
true);
if (afterCXXScope) {
- // Change the declaration context for name lookup, until this function
- // is exited (and the declarator has been parsed).
- DeclScopeObj.EnterDeclaratorScope();
+ if (Actions.ShouldEnterDeclaratorScope(CurScope, D.getCXXScopeSpec()))
+ // Change the declaration context for name lookup, until this function
+ // is exited (and the declarator has been parsed).
+ DeclScopeObj.EnterDeclaratorScope();
}
if (Tok.is(tok::identifier) || Tok.is(tok::kw_operator) ||
OpenPOWER on IntegriCloud