summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2014-05-14 07:54:17 +0000
committerJohn McCall <rjmccall@apple.com>2014-05-14 07:54:17 +0000
commit96766f9b36d4e65dd01ac3e75acae2ab069d2cb6 (patch)
tree87d4dc367e31b0fd966b4cdb8bbd2f2947eca978 /lib/Sema/SemaDecl.cpp
parentdfb7a74bfe4a5ead8fbecd73c054a8c4a32b7a4b (diff)
downloadclang-96766f9b36d4e65dd01ac3e75acae2ab069d2cb6.tar.gz
clang-96766f9b36d4e65dd01ac3e75acae2ab069d2cb6.tar.bz2
clang-96766f9b36d4e65dd01ac3e75acae2ab069d2cb6.tar.xz
Create a redeclaration when an elaborated type specifier
resolves to an existing declaration if there are attributes present. This gives us something to apply the attributes to. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208756 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index 67c78ce904..c43c881f1e 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -10919,14 +10919,17 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
}
if (!Invalid) {
- // If this is a use, just return the declaration we found.
+ // If this is a use, just return the declaration we found, unless
+ // we have attributes.
// FIXME: In the future, return a variant or some other clue
// 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 && (!PrevTagDecl->getFriendObjectKind() ||
- getLangOpts().MicrosoftExt)) || TUK == TUK_Friend)
+ if (!Attr &&
+ ((TUK == TUK_Reference &&
+ (!PrevTagDecl->getFriendObjectKind() || getLangOpts().MicrosoftExt))
+ || TUK == TUK_Friend))
return PrevTagDecl;
// Diagnose attempts to redefine a tag.