================
@@ -6529,43 +6528,6 @@ TEST_P(ErrorHandlingTest,
EXPECT_EQ(OptErr->Error, ASTImportError::UnsupportedConstruct);
}
-// Check a case when a new AST node is created and linked to the AST before
-// encountering the error. The error is set for the counterpart of the nodes in
-// the "from" context.
-TEST_P(ErrorHandlingTest, ErrorHappensAfterNodeIsCreatedAndLinked) {
- TranslationUnitDecl *FromTU = getTuDecl(std::string(R"(
- void f();
- void f() { )") + ErroneousStmt + R"( }
- )",
- Lang_CXX03);
- auto *FromProto = FirstDeclMatcher<FunctionDecl>().match(
- FromTU, functionDecl(hasName("f")));
- auto *FromDef =
- LastDeclMatcher<FunctionDecl>().match(FromTU,
functionDecl(hasName("f")));
- FunctionDecl *ImportedProto = Import(FromProto, Lang_CXX03);
- EXPECT_FALSE(ImportedProto); // Could not import.
- // However, we created two nodes in the AST. 1) the fwd decl 2) the
- // definition. The definition is not added to its DC, but the fwd decl is
- // there.
- TranslationUnitDecl *ToTU = ToAST->getASTContext().getTranslationUnitDecl();
- EXPECT_EQ(DeclCounter<FunctionDecl>().match(ToTU,
functionDecl(hasName("f"))),
- 1u);
----------------
guillem-bartrina-sonarsource wrote:
bebc2571d07e0f93e8919b348e3ea65ddde57e31
https://github.com/llvm/llvm-project/pull/214009
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits