summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2013-07-15 17:27:42 +0000
committerChandler Carruth <chandlerc@gmail.com>2013-07-15 17:27:42 +0000
commit9324d169bd334f051dc6110be7d27772c21eb21e (patch)
tree96498531fe9b25b2a438e64c2eedd4f4fb83b6c0 /clang/lib/Sema/SemaTemplate.cpp
parente59e358823fa31ebb9da5066d49112fc867e092a (diff)
downloadbcm5719-llvm-9324d169bd334f051dc6110be7d27772c21eb21e.tar.gz
bcm5719-llvm-9324d169bd334f051dc6110be7d27772c21eb21e.zip
Re-revert r86040, which was un-reverted in r186199.
This breaks the build of basic patterns with repeated friend declarations. See the added test case in SemaCXX/friend.cpp or the test case reported to the original commit log. Original commit log: If we friend a declaration twice, that should not make it visible to name lookup in the surrounding context. Slightly rework how we handle friend declarations to inherit the visibility of the prior declaration, rather than setting a friend declaration to be visible whenever there was a prior declaration. llvm-svn: 186331
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 6f1ab19f10e..e6006b6bf97 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -1120,7 +1120,8 @@ Sema::CheckClassTemplate(Scope *S, unsigned TagSpec, TagUseKind TUK,
NewClass->setAccess(PrevClassTemplate->getAccess());
}
- NewTemplate->setObjectOfFriendDecl();
+ NewTemplate->setObjectOfFriendDecl(/* PreviouslyDeclared = */
+ PrevClassTemplate != NULL);
// Friend templates are visible in fairly strange ways.
if (!CurContext->isDependentContext()) {
OpenPOWER on IntegriCloud