mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 14:21:09 +01:00
Implement support for mixed-access overload sets. (#6137)
This turns out to be quite important, as several important standard library types (such as `std::string`) have mixed-access overload sets for their constructors as an implementation detail. The overall approach here is: - Use the most permissive access to determine the access of the overload set itself. This affects whether name lookup finds the member name at all. - After overload resolution, re-check the access of the selected member, if it's protected or private. --------- Co-authored-by: Dana Jansens <danakj@orodu.net>
This commit is contained in:
co-authored by
Dana Jansens
parent
83ba714165
commit
3b6d202730
@@ -206,7 +206,8 @@ auto LookupCppOperator(Context& context, SemIR::LocId loc_id, Operator op,
|
||||
}
|
||||
|
||||
return ImportCppOverloadSet(context, SemIR::NameScopeId::None,
|
||||
SemIR::NameId::CppOperator, functions);
|
||||
SemIR::NameId::CppOperator,
|
||||
/*naming_class=*/nullptr, std::move(functions));
|
||||
}
|
||||
|
||||
} // namespace Carbon::Check
|
||||
|
||||
Reference in New Issue
Block a user