https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102305
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 51447 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51447&action=edit gcc12-pr102305.patch Untested fix. is_xible_helper checks ABSTRACT_CLASS_TYPE_P (to) and returns error_mark_node if it is true, but when to is yet uninstantiated class template, it is false and the template is instantiated only later on when trying to make the dummy object. With this patch we instantiate it before checking for abstract classes, but will keep rejecting it or dealing with arrays of unknown bound till the spots that were checking for that before.