diff options
author | Ben Langmuir <blangmuir@apple.com> | 2015-12-10 17:28:51 +0000 |
---|---|---|
committer | Ben Langmuir <blangmuir@apple.com> | 2015-12-10 17:28:51 +0000 |
commit | c589462beb36d4d529dc70fb330546dce22061ff (patch) | |
tree | 429b598c703240dcd060da0a8eab10db6f635087 /clang/lib/Sema/SemaDecl.cpp | |
parent | b247bfb23b1c19ba2b78f61456f20d6924f2ef9d (diff) | |
download | bcm5719-llvm-c589462beb36d4d529dc70fb330546dce22061ff.tar.gz bcm5719-llvm-c589462beb36d4d529dc70fb330546dce22061ff.zip |
[Modules] Fix regression when an elaborated-type-specifier mentions a hidden tag
This makes non-C++ languages find the same decl as C++ does to
workaround a regression introduced in r252960.
rdar://problem/23784203
llvm-svn: 255267
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index af5fdc95c90..1d8f9b7d203 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -12121,10 +12121,12 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, // In C++, we need to do a redeclaration lookup to properly // diagnose some problems. - if (getLangOpts().CPlusPlus) { - Previous.setRedeclarationKind(ForRedeclaration); - LookupQualifiedName(Previous, SearchDC); - } + // FIXME: this lookup is also used (with and without C++) to find a hidden + // declaration so that we don't get ambiguity errors when using a type + // declared by an elaborated-type-specifier. In C that is not correct and + // we should instead merge compatible types found by lookup. + Previous.setRedeclarationKind(ForRedeclaration); + LookupQualifiedName(Previous, SearchDC); } // If we have a known previous declaration to use, then use it. |