summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2015-12-11 22:05:13 +0000
committerBen Langmuir <blangmuir@apple.com>2015-12-11 22:05:13 +0000
commit237ccb165e184b9632358da9b1c094fe9bc18c80 (patch)
treef2a323d0122b87ab70713bb6e831b140016db7a9 /clang/lib/Sema/SemaDecl.cpp
parentb87b58131a170d4bd2abf00e2eaaeb24d696f07f (diff)
downloadbcm5719-llvm-237ccb165e184b9632358da9b1c094fe9bc18c80.tar.gz
bcm5719-llvm-237ccb165e184b9632358da9b1c094fe9bc18c80.zip
Reapply "[Modules] Fix regression when an elaborated-type-specifier mentions a hidden tag"
Now not trying to use a C++ lookup mechanism in C (d'oh). Unqualified lookup is actually fine for this case in C. llvm-svn: 255377
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 6a61ac0e44c..f9c1a014260 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -12136,9 +12136,16 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK,
// In C++, we need to do a redeclaration lookup to properly
// diagnose some problems.
+ // FIXME: redeclaration 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.
if (getLangOpts().CPlusPlus) {
Previous.setRedeclarationKind(ForRedeclaration);
LookupQualifiedName(Previous, SearchDC);
+ } else {
+ Previous.setRedeclarationKind(ForRedeclaration);
+ LookupName(Previous, S);
}
}
OpenPOWER on IntegriCloud