diff --git a/toolchain/lower/file_context.cpp b/toolchain/lower/file_context.cpp index d4de1fa798e0b..52dbcd0bac013 100644 --- a/toolchain/lower/file_context.cpp +++ b/toolchain/lower/file_context.cpp @@ -242,13 +242,12 @@ auto FileContext::BuildFunctionDecl(SemIR::FunctionId function_id) if (SemIR::IsEntryPoint(sem_ir(), function_id)) { // TODO: Add an implicit `return 0` if `Run` doesn't return `i32`. mangled_name = "main"; - } else if (auto name = - sem_ir().names().GetAsStringIfIdentifier(function.name_id)) { + } else { // TODO: Decide on a name mangling scheme. + auto name = sem_ir().names().GetAsStringIfIdentifier(function.name_id); + CARBON_CHECK(name) << "Unexpected special name for function: " + << function.name_id; mangled_name = *name; - } else { - CARBON_FATAL() << "Unexpected special name for function: " - << function.name_id; } llvm::FunctionType* function_type = llvm::FunctionType::get(