mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 18:01:07 +01:00
C++ Interop: Don't crash when trying to call a C++ function with undeduced return type (#6363)
This crashed on trying to build a C++ thunk because the error wasn't propagated. Part of #5436.
This commit is contained in:
@@ -1546,6 +1546,9 @@ static auto GetReturnPattern(Context& context, SemIR::LocId loc_id,
|
||||
// void.
|
||||
return SemIR::InstId::None;
|
||||
}
|
||||
if (type_inst_id == SemIR::ErrorInst::TypeInstId) {
|
||||
return SemIR::ErrorInst::InstId;
|
||||
}
|
||||
auto pattern_type_id = GetPatternType(context, type_id);
|
||||
clang::SourceLocation return_type_loc =
|
||||
clang_decl->getReturnTypeSourceRange().getBegin();
|
||||
|
||||
Reference in New Issue
Block a user