https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118396
--- Comment #16 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Marek Polacek <mpola...@gcc.gnu.org>: https://gcc.gnu.org/g:cb828691fe692f9df002a2e3757a1aec68857e85 commit r15-7127-gcb828691fe692f9df002a2e3757a1aec68857e85 Author: Marek Polacek <pola...@redhat.com> Date: Tue Jan 21 14:48:46 2025 -0500 c++: further tweak to cxx_eval_outermost_constant_expr [PR118396] This patch adds an error in a !allow_non_constant case when the initializer/object types don't match. PR c++/118396 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_outermost_constant_expr): Add an error call when !allow_non_constant. Reviewed-by: Jason Merrill <ja...@redhat.com>