Support calling Carbon destructors from C++ (#7143)

A destructor is added to the C++ class definition in
`CarbonExternalASTSource::CompleteType`. The destructor calls a Carbon
function that calls the `Destroy` operator.
This commit is contained in:
Nicholas Bishop
2026-05-04 20:28:58 +00:00
committed by GitHub
parent f8dd4d85bf
commit 1bc329af14
7 changed files with 498 additions and 132 deletions
+2
View File
@@ -641,6 +641,8 @@ auto CarbonExternalASTSource::CompleteType(clang::TagDecl* tag_decl) -> void {
ExportAllFieldsToCpp(*context_, class_info);
class_decl->addDecl(ExportDestructorToCpp(*context_, class_info, class_decl));
// TODO: Import any special member functions that affect class properties.
class_decl->completeDefinition();
}