]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: consteval propagation and templates [PR115986]
authorJason Merrill <jason@redhat.com>
Fri, 26 Jul 2024 21:20:18 +0000 (17:20 -0400)
committerJason Merrill <jason@redhat.com>
Sat, 27 Jul 2024 20:26:04 +0000 (16:26 -0400)
commita9e9f772c7488ac0c09dd92f28890bdab939771a
tree613d7521015b9237052168d72e5402160081e664
parent3129a2ed6a764c0687efaca9eba53dcf12d1d8a0
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.
gcc/cp/cp-gimplify.cc
gcc/testsuite/g++.dg/cpp2a/consteval-prop21.C [new file with mode: 0644]