mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 07:21:04 +01:00
Ensure vtable entries for generics are attached constants (#5853)
Otherwise these end up as unattached constants (see the baseline test changes) and can't be resolved by `GetConstantValueInSpecific` in lowering or in further derived vtables. If the class is non-generic, then it's fine for the vtable entry for some function inherited from a generic base is represented as an unattached constant, since the specific in that specific_function is already fully resolved. --------- Co-authored-by: Dana Jansens <danakj@orodu.net>
This commit is contained in:
co-authored by
Dana Jansens
parent
5de47962b0
commit
26ec78ec00
@@ -978,7 +978,7 @@ auto FileContext::BuildVtable(const SemIR::Vtable& vtable,
|
||||
vfuncs.reserve(vtable_inst_block.size());
|
||||
|
||||
for (auto fn_decl_id : vtable_inst_block) {
|
||||
auto [fn_decl, fn_id, fn_specific_id] =
|
||||
auto [_1, _2, fn_id, fn_specific_id] =
|
||||
DecomposeVirtualFunction(sem_ir(), fn_decl_id, specific_id);
|
||||
|
||||
vfuncs.push_back(llvm::ConstantExpr::getTrunc(
|
||||
|
||||
Reference in New Issue
Block a user