summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-06-08 21:27:36 +0000
committerDouglas Gregor <dgregor@apple.com>2010-06-08 21:27:36 +0000
commit6f2e095f064a24f44d385874c162dc8f764088fb (patch)
tree223d48bf371f30ee938d2693ff6a4be7b1df3b8d /clang/lib/Sema
parentce21919bd696d9be6d694a8885ff59d40fe57165 (diff)
downloadbcm5719-llvm-6f2e095f064a24f44d385874c162dc8f764088fb.tar.gz
bcm5719-llvm-6f2e095f064a24f44d385874c162dc8f764088fb.zip
When referring to a tag that was previously declared only as a friend,
build a new declaration for that tag type that will be visible for future lookups of that tag. llvm-svn: 105643
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 03b2ef56430..249cbef38a1 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -5238,7 +5238,8 @@ Sema::DeclPtrTy Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
// for the consumer of this Decl to know it doesn't own it.
// For our current ASTs this shouldn't be a problem, but will
// need to be changed with DeclGroups.
- if (TUK == TUK_Reference || TUK == TUK_Friend)
+ if ((TUK == TUK_Reference && !PrevTagDecl->getFriendObjectKind()) ||
+ TUK == TUK_Friend)
return DeclPtrTy::make(PrevTagDecl);
// Diagnose attempts to redefine a tag.
OpenPOWER on IntegriCloud