mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 11:31:05 +01:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user