From 1cc58bbd7fe2e605cdd97540d770a0b3a5cd7fd3 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 7 Jan 2026 13:25:27 +0100 Subject: [PATCH] Add extra comment to eval_access_context_current for inherited ctor handling. --- gcc/cp/reflect.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/cp/reflect.cc b/gcc/cp/reflect.cc index 5dddc52f380..45483f4e865 100644 --- a/gcc/cp/reflect.cc +++ b/gcc/cp/reflect.cc @@ -6224,6 +6224,9 @@ eval_access_context_current (location_t loc, const constexpr_ctx *ctx, push_access_scope. */ if (scope == NULL_TREE && current_function_decl) scope = current_function_decl_without_access_scope (); + /* [meta.reflection.access.context]/(5.1.2): Otherwise, if an initialization + by an inherited constructor is using I, a point whose immediate scope is + the class scope corresponding to C. */ if (scope && DECL_INHERITED_CTOR (scope)) scope = DECL_CONTEXT (scope); if (scope == NULL_TREE)