When importing a trivial destructor from C++, produce a no_op builtin. (#6531)

This avoids us trying to produce a reference to the C++ destructor,
which Clang won't emit because it believes it's unnecessary. This
previously led to link errors.

Fixe #6502.
This commit is contained in:
Richard Smith
2025-12-23 05:30:29 +00:00
committed by GitHub
parent 29018f38a6
commit 531d063596
8 changed files with 81 additions and 47 deletions
@@ -807,7 +807,7 @@ fn Call() {
// CHECK:STDOUT:
// CHECK:STDOUT: fn @DestroyOp(%self.param: %X) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: fn @X.cpp_destructor(%self.param: %X);
// CHECK:STDOUT: fn @X.cpp_destructor(%self.param: %X) = "no_op";
// CHECK:STDOUT:
// CHECK:STDOUT: --- fail_call_too_few_args.carbon
// CHECK:STDOUT: