From c5e2f34df1c545f792e750d564ee58368197ae62 Mon Sep 17 00:00:00 2001 From: Steve Naroff Date: Wed, 26 Mar 2008 21:27:00 +0000 Subject: [PATCH] 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 --- lib/Sema/SemaDecl.cpp | 7 ++++--- 1 file 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; ... -- 2.40.0