Restrict redeclaration of tags introduced by using decls to MSVCCompat
This limits the facility added in r199490 while we seek clarification on the
standard.
llvm-svn: 199531
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 62fedbf..f71540c 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -10681,8 +10681,9 @@
}
if (!Previous.empty()) {
- NamedDecl *DirectPrevDecl = *Previous.begin();
- NamedDecl *PrevDecl = DirectPrevDecl->getUnderlyingDecl();
+ NamedDecl *PrevDecl = Previous.getFoundDecl();
+ NamedDecl *DirectPrevDecl =
+ getLangOpts().MSVCCompat ? *Previous.begin() : PrevDecl;
// 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