mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 01:48:12 +00: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:
13 files changed
+649
-194
No files matched your search
@@ -14,7 +14,7 @@ auto CheckFunctionTypeMatches(Context& context,
|
||||
const SemIR::Function& new_function,
|
||||
const SemIR::Function& prev_function,
|
||||
SemIR::SpecificId prev_specific_id,
|
||||
bool check_syntax) -> bool {
|
||||
bool check_syntax, bool check_self) -> bool {
|
||||
// TODO: When check_syntax is false, the functions should be allowed to have
|
||||
// different signatures as long as we can synthesize a suitable thunk. i.e.,
|
||||
// when there's an implicit conversion from the original parameter types to
|
||||
@@ -23,7 +23,7 @@ auto CheckFunctionTypeMatches(Context& context,
|
||||
// Also, build that thunk.
|
||||
if (!CheckRedeclParamsMatch(context, DeclParams(new_function),
|
||||
DeclParams(prev_function), prev_specific_id,
|
||||
check_syntax)) {
|
||||
/*diagnose=*/true, check_syntax, check_self)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user