diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-06-08 21:27:36 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-06-08 21:27:36 +0000 |
commit | e1aa9f3a5d3e2c0f8a5606e82eef3c65a6f30672 (patch) | |
tree | 275380caf39f46482f85350bd2a17503f3f1dda3 /lib/Sema/SemaDecl.cpp | |
parent | ccd471341d2edbb18ac9c46a7c65d280d9c6223e (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105643 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 03b2ef5643..249cbef38a 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/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. |