diff options
author | John McCall <rjmccall@apple.com> | 2009-12-11 20:04:54 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2009-12-11 20:04:54 +0000 |
commit | 2b058ef245469d50005b44950dbc683cf12e86f7 (patch) | |
tree | a5edf8d9e60680e6cc1b418dcd83c256aee575ee /clang/lib/Parse/ParseDecl.cpp | |
parent | 6d306bb32b9eae05e51d8fcaa254949db715fafc (diff) | |
download | bcm5719-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.cpp | 7 |
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) || |