From c06ee808d774a53f38dd746f83b701390c7919cd Mon Sep 17 00:00:00 2001 From: Steve Naroff Date: Wed, 26 Mar 2008 21:27:00 +0000 Subject: Alloc redeclaration of typedefs within ExternCSystemHeaderDir's AND SystemHeaderDir's. llvm-svn: 48841 --- clang/lib/Sema/SemaDecl.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'clang/lib/Sema/SemaDecl.cpp') 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; ... -- cgit v1.2.3