mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 20:42:01 +01:00
Support for initialization of classes with abstract base classes. (#6802)
When initializing `.base` in class initialization, use `partial Base` as the destination type rather than `Base`. Treat `partial Base` as not being abstract even when `Base` is. Allow conversion from a `partial T` initializer to a `T` initializer. Store the vptr while performing the conversion. Do not store the vptr when performing a `partial T` initialization, only when performing a non-partial `T` initialization.
This commit is contained in:
@@ -773,6 +773,13 @@ auto EvalConstantInst(Context& context, SemIR::UnaryOperatorNot inst)
|
||||
return ConstantEvalResult::NotConstant;
|
||||
}
|
||||
|
||||
auto EvalConstantInst(Context& /*context*/, SemIR::UpdateInit /*inst*/)
|
||||
-> ConstantEvalResult {
|
||||
// TODO: Support folding together a ClassInit with an update that sets the
|
||||
// vptr.
|
||||
return ConstantEvalResult::TODO;
|
||||
}
|
||||
|
||||
auto EvalConstantInst(Context& context, SemIR::ValueOfInitializer inst)
|
||||
-> ConstantEvalResult {
|
||||
// Values of value expressions and initializing expressions are represented in
|
||||
|
||||
Reference in New Issue
Block a user