Alloc redeclaration of typedefs within ExternCSystemHeaderDir's AND SystemHeaderDir's.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48841 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index e9922df..9429d4b 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -220,11 +220,12 @@
DirectoryLookup::DirType OldDirType = HdrInfo.getFileDirFlavor(OldDeclFile);
DirectoryLookup::DirType NewDirType = HdrInfo.getFileDirFlavor(NewDeclFile);
- if ((OldDirType == DirectoryLookup::ExternCSystemHeaderDir ||
- NewDirType == DirectoryLookup::ExternCSystemHeaderDir) ||
+ // Allow reclarations in both SystemHeaderDir and ExternCSystemHeaderDir.
+ if ((OldDirType != DirectoryLookup::NormalHeaderDir ||
+ NewDirType != DirectoryLookup::NormalHeaderDir) ||
getLangOptions().Microsoft)
return New;
-
+
// TODO: CHECK FOR CONFLICTS, multiple decls with same name in one scope.
// TODO: This is totally simplistic. It should handle merging functions
// together etc, merging extern int X; int X; ...