diff options
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 1d8f9b7d203..af5fdc95c90 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -12121,12 +12121,10 @@ Decl *Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, // In C++, we need to do a redeclaration lookup to properly // diagnose some problems. - // 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 (getLangOpts().CPlusPlus) { + Previous.setRedeclarationKind(ForRedeclaration); + LookupQualifiedName(Previous, SearchDC); + } } // If we have a known previous declaration to use, then use it. |