]> 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)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 28 Jul 2024 17:06:02 +0000 (19:06 +0200)
commit25ace453ff530251978bac22af2c0932aa5da5ad
treea18cb5ca851b12bcf926f9a63ab30436faa8529f
parentb300fd3985cc1435ecea30d18d00bfab8022d091
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]