diff options
author | Alp Toker <alp@nuanti.com> | 2014-01-17 12:57:21 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-01-17 12:57:21 +0000 |
commit | 320374c4b167d61a7ae0dbbc73028cf67a357ddb (patch) | |
tree | 1581a0ee1e455cc1cfc604d91d147c420ca57694 /clang/lib/Sema/SemaDecl.cpp | |
parent | bf2b652c05fbfd3b79381220726d4584a063eef3 (diff) | |
download | bcm5719-llvm-320374c4b167d61a7ae0dbbc73028cf67a357ddb.tar.gz bcm5719-llvm-320374c4b167d61a7ae0dbbc73028cf67a357ddb.zip |
Permit redeclaration of tags introduced by using decls
This valid construct appears in MSVC headers where it's used to provide a
definition for the '::type_info' compiler builtin type.
llvm-svn: 199490
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index e14fc53750c..62fedbf9691 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -10681,7 +10681,8 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, } if (!Previous.empty()) { - NamedDecl *PrevDecl = (*Previous.begin())->getUnderlyingDecl(); + NamedDecl *DirectPrevDecl = *Previous.begin(); + NamedDecl *PrevDecl = DirectPrevDecl->getUnderlyingDecl(); // It's okay to have a tag decl in the same scope as a typedef // which hides a tag decl in the same scope. Finding this @@ -10713,7 +10714,7 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, // in the same scope (so that the definition/declaration completes or // rementions the tag), reuse the decl. if (TUK == TUK_Reference || TUK == TUK_Friend || - isDeclInScope(PrevDecl, SearchDC, S, + isDeclInScope(DirectPrevDecl, SearchDC, S, SS.isNotEmpty() || isExplicitSpecialization)) { // Make sure that this wasn't declared as an enum and now used as a // struct or something similar. |