summaryrefslogtreecommitdiffstats
path: root/clang/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
commitc06ee808d774a53f38dd746f83b701390c7919cd (patch)
treef73f9f5b26fda53d65ee3cc85e18800714e66cc4 /clang/lib/Sema/SemaDecl.cpp
parent19e24df3a45703d5e3c888c914a0996eb58e92ea (diff)
downloadbcm5719-llvm-c06ee808d774a53f38dd746f83b701390c7919cd.tar.gz
bcm5719-llvm-c06ee808d774a53f38dd746f83b701390c7919cd.zip
Alloc redeclaration of typedefs within ExternCSystemHeaderDir's AND SystemHeaderDir's.
llvm-svn: 48841
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index e9922dfdf99..9429d4b4130 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/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; ...
OpenPOWER on IntegriCloud