https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96215
Marek Polacek <mpolacek at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mpolacek at gcc dot gnu.org --- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> --- We consider those COMPONENT_REFs as instantiation-dependent because: instantiation_dependent_r: case COMPONENT_REF: if (identifier_p (TREE_OPERAND (*tp, 1))) /* In a template, finish_class_member_access_expr creates a COMPONENT_REF with an IDENTIFIER_NODE for op1 even if it isn't type-dependent, so that we can check access control at instantiation time (PR 42277). See also Core issue 1273. */ return *tp;