+++ This bug was initially created as a clone of Bug #116108 +++ template <class T> struct S { struct U { S s; } u; }; S t{2}; (or cv qualified versions thereof somewhere) or say template <class T> struct S { struct U { struct V { const struct W { const S s; } w; } v; } u; }; S t{2}; still ICE, looking just at currently_open_class isn't enough, there can be many open classes at the same time. All this still started with r10-4719-g9b41ebbcdf9e33285a0eebeb7c841afe20e4a7c1
Do we need - && same_type_p (TYPE_MAIN_VARIANT (type), - current_class_type)) + && currently_open_class (TYPE_MAIN_VARIANT (type)) or something else?
Working on it.
Thanks for the report. I'm currently testing a patch that leverages TYPE_BEING_DEFINED instead or looking at current_class_type.
Patch submitted in https://gcc.gnu.org/pipermail/gcc-patches/2024-December/672144.html