Handle "gaps" in C++ vtables. (#7206)

Not every entry in a C++ vtable corresponds to a function that we want
to import. For the holes, leave a `SemIR::InstId::None` in the vtable.
Also mark vtables that extend a C++ vtable as being non-Carbon-native so
we don't try to lower them (and crash on the `None` entries).

In particular, we leave holes for destructors, since we don't have
destructor declarations on the Carbon side that need to override them.
This commit is contained in:
Richard Smith
2026-05-14 00:38:24 +00:00
committed by GitHub
parent bd918fb33b
commit c9d8b59bbd
6 changed files with 128 additions and 93 deletions
@@ -522,6 +522,8 @@ fn GenericUse(p2: Generic(Cpp.Class1)) {
// CHECK:STDOUT: }
// CHECK:STDOUT:
// CHECK:STDOUT: vtable @Bar.vtable {
// CHECK:STDOUT: invalid
// CHECK:STDOUT: invalid
// CHECK:STDOUT: imports.%Bar.f.decl
// CHECK:STDOUT: }
// CHECK:STDOUT: