aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-03-26 21:27:00 +0000
committerSteve Naroff <snaroff@apple.com>2008-03-26 21:27:00 +0000
commitc5e2f34df1c545f792e750d564ee58368197ae62 (patch)
tree1a8b314e52d6b339f8b04b7902d7d9b701d6398b /lib/Sema/SemaDecl.cpp
parent8c1a9a80ba2e200f9180867e133563b15223dca2 (diff)
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
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r--lib/Sema/SemaDecl.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index e9922dfdf9..9429d4b413 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/lib/Sema/SemaDecl.cpp
@@ -220,11 +220,12 @@ TypedefDecl *Sema::MergeTypeDefDecl(TypedefDecl *New, ScopedDecl *OldD) {
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; ...