mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Add error for virtual member function without self (#5005)
This tripped over a lowering crash when a member function with self was declared-but-not-defined, so that's why some test cases were updated to have (empty) function definitions. I'll follow-up with/look into a fix for the self-declared-but-not-defined cases separately. --------- Co-authored-by: Jon Ross-Perkins <jperkins@google.com> Co-authored-by: Carbon Infra Bot <carbon-external-infra@google.com>
This commit is contained in:
co-authored by
Jon Ross-Perkins
Carbon Infra Bot
parent
467e510d40
commit
f97f1a3e11
@@ -254,7 +254,8 @@ static auto MergeImplRedecl(Context& context, SemIR::Impl& new_impl,
|
||||
// `impl`. Keep looking for a prior declaration without issuing a diagnostic.
|
||||
if (!CheckRedeclParamsMatch(context, DeclParams(new_impl),
|
||||
DeclParams(prev_impl), SemIR::SpecificId::None,
|
||||
/*check_syntax=*/true, /*diagnose=*/false)) {
|
||||
/*diagnose=*/false, /*check_syntax=*/true,
|
||||
/*check_self=*/true)) {
|
||||
// NOLINTNEXTLINE(readability-simplify-boolean-expr)
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user