mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 10:51:06 +01:00
Fix C++ thunk triggering for functions with default args which return a simple type (#6152)
Before this change, we wrongly ignore the decision to generate a thunk for a function with default args by overriding this decision with the fact the return type by itself doesn't require a thunk. This causes not generating a thunk which leads to crashing in lowering. Add tests that show that now thunk is generated in `check` and it no longer crashes in `lower`. Follow up of #6108.
This commit is contained in:
@@ -120,7 +120,8 @@ auto IsCppThunkRequired(Context& context, const SemIR::Function& function)
|
||||
if (return_type_id == SemIR::ErrorInst::TypeId) {
|
||||
return false;
|
||||
}
|
||||
thunk_required = IsThunkRequiredForType(context, return_type_id);
|
||||
thunk_required =
|
||||
thunk_required || IsThunkRequiredForType(context, return_type_id);
|
||||
}
|
||||
|
||||
for (auto param_id :
|
||||
|
||||
Reference in New Issue
Block a user