forked from OSchip/llvm-project
Alloc redeclaration of typedefs within ExternCSystemHeaderDir's AND SystemHeaderDir's.
llvm-svn: 48841
This commit is contained in:
parent
19e24df3a4
commit
c06ee808d7
|
@ -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; ...
|
||||
|
|
Loading…
Reference in New Issue