mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 10:11:06 +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:
@@ -30,6 +30,9 @@ static auto GetGlobalDecl(const clang::FunctionDecl* decl)
|
||||
if (const auto* ctor = dyn_cast<clang::CXXConstructorDecl>(decl)) {
|
||||
return clang::GlobalDecl(ctor, clang::CXXCtorType::Ctor_Complete);
|
||||
}
|
||||
if (const auto* dtor = dyn_cast<clang::CXXDestructorDecl>(decl)) {
|
||||
return clang::GlobalDecl(dtor, clang::CXXDtorType::Dtor_Complete);
|
||||
}
|
||||
return clang::GlobalDecl(decl);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user