mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 19:31:08 +01:00
teaches arithmetic interfaces about C++ operators (#7123)
This commit is contained in:
@@ -250,6 +250,10 @@ auto CheckFunctionReturnTypeMatches(Context& context,
|
||||
}
|
||||
if (!context.types().AreEqualAcrossDeclarations(new_return_type_id,
|
||||
prev_return_type_id)) {
|
||||
if (new_function.name_id == SemIR::NameId::CppOperator &&
|
||||
!prev_return_type_id.has_value()) {
|
||||
return true;
|
||||
}
|
||||
if (!diagnose) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user