Skip to content

Commit 19bbdfa

Browse files
committed
Catch errors in instantiations the implicit members need
1 parent 2dea857 commit 19bbdfa

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎cpp2rust/converter/converter_lib.cpp‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1641,13 +1641,14 @@ void DefineImplicitMembers(clang::Sema &sema, clang::CXXRecordDecl *decl) {
16411641
sema.ForceDeclarationOfImplicitMembers(decl);
16421642
auto define = [&](clang::FunctionDecl *fn, auto &&definer) {
16431643
RuleDecls::Trial trial(sema);
1644+
clang::DiagnosticErrorTrap errors(sema.getDiagnostics());
16441645
{
16451646
clang::Sema::GlobalEagerInstantiationScope instantiations(
16461647
sema, /*Enabled=*/true, /*AtEndOfTU=*/false);
16471648
definer();
16481649
instantiations.perform();
16491650
}
1650-
if (trial.failed()) {
1651+
if (trial.failed() || errors.hasErrorOccurred()) {
16511652
fn->setDeletedAsWritten(true);
16521653
}
16531654
};

0 commit comments

Comments
 (0)