[Bug c++/122668] [15/16 regression] error: 'class TestClass<T>' has no member named 'member_function' [-Wtemplate-body]

ppalka at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Nov 13 17:34:49 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122668

--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Oops, I didn't realize it was a regression!

IIUC the underlying issue is that we don't treat the noexcept-spec of a friend
as a complete-class context, same as PR114764. And indeed r15-2117 exposed this
underlying issue in the case where the noexcept-spec does name lookup within
the current instantiation, before that commit we'd just silently repeat the
lookup at instantiation time.

> It seems like we need to treat TestClass as dependentish in this context, perhaps just add TYPE_BEING_DEFINED to dependentish_scope_p?
Makes sense, maybe also '&& cp_noexcept_operand' since IIUC this particular bug
is specific to noexcept-specs.


More information about the Gcc-bugs mailing list