mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-21 11:26:37 +00:00
Fix accessing protected members from templates derived classes (#7780)
When evaluating a deferred member access action, the scope stack cannot be relied on, so `LookupUnqualifiedName` cannot be used in `GetHighestAllowedAccess` to get the `Self` type. Instead, store the `Self` type in the `Context` when evaluating a method, and use that in `GetHighestAllowedAccess`.
This commit is contained in:
1 parent
413ac55d4f
commit
dbf79d5229
10 files changed
+323
-80
No files matched your search
@@ -122,7 +122,7 @@ auto CheckCppOverloadAccess(
|
||||
auto name_scope_const_id = context.constant_values().Get(
|
||||
context.name_scopes().Get(parent_scope_id).inst_id());
|
||||
SemIR::AccessKind allowed_access_kind =
|
||||
GetHighestAllowedAccess(context, loc_id, name_scope_const_id);
|
||||
GetHighestAllowedAccess(context, name_scope_const_id);
|
||||
CheckAccess(context, loc_id, SemIR::LocId(overload_inst_id), function.name_id,
|
||||
member_access_kind,
|
||||
/*is_parent_access=*/false,
|
||||
|
||||
Reference in new issue
Block a user