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 authored and GitHub committed 2026-05-04 20:28:58 +00:00
1 parent f8dd4d85bf
commit 1bc329af14
7 files changed
+498 -132

No files matched your search

+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();
}