mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-15 11:08:31 +00:00
This allows a generic class to inherit from a virtual C++ class as long as the subclass doesn't override any methods. See toolchain/lower/testdata/interop/cpp/class/import/inherit.carbon for a working example. The TODO in `CheckCompleteClassType` is now in `CarbonExternalASTSource::CompleteType`, and only triggers if virtual function thunks need to be defined. A fix in `FileContext::BuildVtable` is also needed: when looking up the clang decl associated with the vtable, if the class is generic then the `ClassTemplateSpecializationDecl` associated with the specific is needed. This required adding `ConstantStore::Get`, since only `const` access is allowed during lowering.