https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81167
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org, | |jason at gcc dot gnu.org, | |nathan at gcc dot gnu.org --- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I think it is fine that %H/%I crash on bogus arguments, but we should fix here the real bug. + if (! DECL_CONSTRUCTOR_P (w->fn) + && TREE_TYPE (source)) looks just like a workaround. The main question is what is: tree source = source_type (w->convs[0]); if (! DECL_CONSTRUCTOR_P (w->fn)) source = TREE_TYPE (source); code meant to do exactly, I bet it relies on the assumption that this argument to w->fn must be a POINTER_TYPE_P, but in this case source is neither pointer nor reference type, because source_type looked through the ck_ref_bind conversion which had reference to bar type to the next conversion which is ck_identity with bar type. So, source already is a RECORD_TYPE rather than a pointer/reference.