mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 19:31:08 +01:00
Support for calling C++ destructors. (#6453)
Synthesize an impl of `Destroy` for C++ classes in response to impl lookup.
This commit is contained in:
@@ -1624,11 +1624,6 @@ static auto CreateFunctionParamsInsts(Context& context, SemIR::LocId loc_id,
|
||||
clang::FunctionDecl* clang_decl,
|
||||
int num_params)
|
||||
-> std::optional<FunctionParamsInsts> {
|
||||
if (isa<clang::CXXDestructorDecl>(clang_decl)) {
|
||||
context.TODO(loc_id, "Unsupported: Destructor");
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
auto implicit_param_patterns_id =
|
||||
MakeImplicitParamPatternsBlockId(context, loc_id, *clang_decl);
|
||||
if (!implicit_param_patterns_id.has_value()) {
|
||||
@@ -1668,6 +1663,10 @@ static auto GetFunctionName(Context& context, clang::FunctionDecl* clang_decl)
|
||||
.name_id;
|
||||
}
|
||||
|
||||
case clang::DeclarationName::CXXDestructorName: {
|
||||
return SemIR::NameId::CppDestructor;
|
||||
}
|
||||
|
||||
case clang::DeclarationName::CXXOperatorName: {
|
||||
return SemIR::NameId::CppOperator;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user