Skip to content

Commit ea4ec00

Browse files
authored
Revert "[clang] Fix of a crash 'Cannot get layout of forward declarations!' during CTU static analysis" (#156010)
Reverts #155375 Test does not work correctly on MacOS.
1 parent fcc7867 commit ea4ec00

File tree

2 files changed

+1
-55
lines changed

2 files changed

+1
-55
lines changed

clang/lib/AST/ASTImporter.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,21 +1740,10 @@ ExpectedType ASTNodeImporter::VisitDeducedTemplateSpecializationType(
17401740
}
17411741

17421742
ExpectedType ASTNodeImporter::VisitTagType(const TagType *T) {
1743-
TagDecl *DeclForType = T->getOriginalDecl();
1744-
Expected<TagDecl *> ToDeclOrErr = import(DeclForType);
1743+
Expected<TagDecl *> ToDeclOrErr = import(T->getOriginalDecl());
17451744
if (!ToDeclOrErr)
17461745
return ToDeclOrErr.takeError();
17471746

1748-
if (DeclForType->isUsed()) {
1749-
// If there is a definition of the 'OriginalDecl', it should be imported to
1750-
// have all information for the type in the "To" AST. (In some cases no
1751-
// other reference may exist to the definition decl and it would not be
1752-
// imported otherwise.)
1753-
Expected<TagDecl *> ToDefDeclOrErr = import(DeclForType->getDefinition());
1754-
if (!ToDefDeclOrErr)
1755-
return ToDefDeclOrErr.takeError();
1756-
}
1757-
17581747
if (T->isCanonicalUnqualified())
17591748
return Importer.getToContext().getCanonicalTagType(*ToDeclOrErr);
17601749

clang/test/Analysis/ctu-import-type-decl-definition.c

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)