[Bug c++/123677] [16 Regression] ICE: tree check: expected constructor, have ptrmem_cst in cxx_eval_store_expression, at cp/constexpr.cc since r16-3022

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 20 16:44:41 GMT 2026


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 63428
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63428&action=edit
gcc16-pr123677.patch

Untested fix.
The CLOBBER constexpr store code was assuming that for AGGREGATE_TYPE_P if
*valp is non-NULL, it must be a CONSTRUCTOR.  But that is not the case as the
testcase shows, it can be also PTRMEM_CST if TYPE_PTRMEMFUNC_P (type).  Rather
than adding a special case for that, this patch just verifies it is a
CONSTRUCTOR and
overwrites it otherwise.


More information about the Gcc-bugs mailing list