Summary:
Implicit CXXRecordDecl is not added to its DeclContext during import, but in
the original AST it is. This patch fixes this.
Reviewers: xazax.hun, a.sidorin, szepet
Subscribers: rnkovacs, dkrupp, cfe-commits
Differential Revision: https://reviews.llvm.org/D46958
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@332588
91177308-0d34-0410-b5e6-
96231b3b80d8
D2 = D2CXX;
D2->setAccess(D->getAccess());
D2->setLexicalDeclContext(LexicalDC);
- if (!DCXX->getDescribedClassTemplate())
+ if (!DCXX->getDescribedClassTemplate() || DCXX->isImplicit())
LexicalDC->addDeclInternal(D2);
Importer.Imported(D, D2);
Verifier.match(To, cxxRecordDecl(hasFieldOrder({"a", "b", "c"}))));
}
-TEST_P(ASTImporterTestBase, DISABLED_ShouldImportImplicitCXXRecordDecl) {
+TEST_P(ASTImporterTestBase, ShouldImportImplicitCXXRecordDecl) {
Decl *From, *To;
std::tie(From, To) = getImportedDecl(
R"(