summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-10-13 06:22:15 +0000
committerJohn McCall <rjmccall@apple.com>2010-10-13 06:22:15 +0000
commitccbc0321460545b2928a72c212837eb6304dcb8f (patch)
tree389e981ea7b7c3c72865f4e836bda17d6d64072d /clang/lib/Sema/SemaDeclCXX.cpp
parentfe92a9384e092453f206c086714fb8c71e9b1731 (diff)
downloadbcm5719-llvm-ccbc0321460545b2928a72c212837eb6304dcb8f.tar.gz
bcm5719-llvm-ccbc0321460545b2928a72c212837eb6304dcb8f.zip
Preserve the original scope when picking the right scope for a friend
declaration, because we'll need it later. Hopefully fixed self-host. llvm-svn: 116399
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 62ac3bb455c..55f668b5c51 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -6337,6 +6337,7 @@ Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, bool IsDefinition,
// The context we found the declaration in, or in which we should
// create the declaration.
DeclContext *DC;
+ Scope *DCScope = S;
LookupResult Previous(*this, NameInfo, LookupOrdinaryName,
ForRedeclaration);
@@ -6395,7 +6396,7 @@ Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, bool IsDefinition,
&& !getLangOptions().CPlusPlus0x)
Diag(DS.getFriendSpecLoc(), diag::err_friend_is_member);
- S = getScopeForDeclContext(S, DC);
+ DCScope = getScopeForDeclContext(S, DC);
// - There's a non-dependent scope specifier, in which case we
// compute it and do a previous lookup there for a function
@@ -6454,7 +6455,7 @@ Decl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, bool IsDefinition,
}
bool Redeclaration = false;
- NamedDecl *ND = ActOnFunctionDeclarator(S, D, DC, T, TInfo, Previous,
+ NamedDecl *ND = ActOnFunctionDeclarator(DCScope, D, DC, T, TInfo, Previous,
move(TemplateParams),
IsDefinition,
Redeclaration);
OpenPOWER on IntegriCloud