https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115986
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Jason Merrill <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:a9e9f772c7488ac0c09dd92f28890bdab939771a commit r15-2362-ga9e9f772c7488ac0c09dd92f28890bdab939771a Author: Jason Merrill <ja...@redhat.com> Date: Fri Jul 26 17:20:18 2024 -0400 c++: consteval propagation and templates [PR115986] Here the call to e() makes us decide to check d() for escalation at EOF, but while checking it we try to fold_immediate 0_c, and get confused by the template trees. Let's not mess with escalation for function templates. PR c++/115986 gcc/cp/ChangeLog: * cp-gimplify.cc (remember_escalating_expr): Skip function templates. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/consteval-prop21.C: New test.