mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 19:31:08 +01:00
Support arbitrary parameter forms in MakeGeneratedFunctionDecl (#7654)
This allows generated functions to have different forms for different parameters, and by-ref or by-value return forms. As a byproduct, this allows generated functions to supply a return type _inst_ ID when they have one, which preserves things like location information.
This commit is contained in:
@@ -271,8 +271,9 @@ static auto MakeCppStdInitializerListMake(Context& context, SemIR::LocId loc_id,
|
||||
{.parent_scope_id = init_list_class.scope_id,
|
||||
.name_id = init_list_class.name_id,
|
||||
.param_type_ids = {array_type_id},
|
||||
.param_kind = ParamPatternKind::Value,
|
||||
.return_type_id = init_list_type_id});
|
||||
.param_kinds = {ParamPatternKind::Value},
|
||||
.return_form = ReturnExprAsForm(
|
||||
context, loc_id, init_list_type_inst_id)});
|
||||
|
||||
auto& function = context.functions().Get(function_id);
|
||||
CARBON_CHECK(IsValidBuiltinDeclaration(
|
||||
|
||||
Reference in New Issue
Block a user