mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 19:40:10 +01:00
If a Carbon class overrides virtual functions from a C++ base class but is never referenced from C++, it is never exported to Clang. During lowering, `BuildVtable` then fails to find a `CXXRecordDecl` and crashes when attempting to get the vtable from Clang's code generator. Ensure dynamic classes with foreign vtables are exported to Clang when completing the class definition in `CheckCompleteClassType`, and look up `first_decl_id()` in `BuildVtable`. Fixes #7721 --------- Co-authored-by: Dana Jansens <danakj@orodu.net>