diff options
author | John McCall <rjmccall@apple.com> | 2014-05-14 07:54:17 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2014-05-14 07:54:17 +0000 |
commit | 2976f8b011a0845f1b0865150036cf3f48a61cbf (patch) | |
tree | 0a0a53e27e82bb4ed2160aa25eba44d3023eb7bb /clang/lib/Sema/SemaDecl.cpp | |
parent | adc3ff9f48475903255f05e2d84e7c9ef3409dd6 (diff) | |
download | bcm5719-llvm-2976f8b011a0845f1b0865150036cf3f48a61cbf.tar.gz bcm5719-llvm-2976f8b011a0845f1b0865150036cf3f48a61cbf.zip |
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.
llvm-svn: 208756
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 67c78ce904a..c43c881f1ef 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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. |