[Bug c++/123376] [16 Regression] ICE in write_type when building qt6-qtscxml with -flto -ffat-lto-objects since r16-3821
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jan 5 13:32:30 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=123376
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
ICEs even with
template <typename T> void foo (void *, void *) { new T; }
using C = void (*) (void *, void *);
template <typename T> struct D { static constexpr C foo = ::foo <T>; };
struct E { void (*bar) (void *, void *); };
constexpr bool v = false;
template <typename T, typename> void baz () { E { D<T>::foo }; }
template <class, class, bool> struct F;
template <class R, class E> struct F <R, E, false> { static void qux () { baz
<R, E> (); } };
template <typename... T> void corge () { (F <T, void, v>::qux (), ...); }
template <auto S> struct G { long long val = 0; };
struct H {
virtual void garply ();
void plugh (const int &);
G <&H::plugh> h;
};
void fred () { corge <H> (); }
where int isn't used anywhere.
Anyway, r16-3821 says that "(block vars or type fields) are already handled
explicitly elsewhere" which is clearly not the case,
/* Push all TYPE_FIELDS - there can be interleaving interesting
and non-interesting things. */
tem = TYPE_FIELDS (t);
while (tem)
{
if (TREE_CODE (tem) == FIELD_DECL)
fld_worklist_push (tem, fld);
tem = TREE_CHAIN (tem);
}
only handles FIELD_DECLs from TYPE_FIELDS, not also FUNCTION_DECLs or other
entities.
More information about the Gcc-bugs
mailing list