]> git.feebdaed.xyz Git - 0xmirror/gcc.git/commit
c++: fix function body cloning when using implicit constexpr
authorYuao Ma <c8ef@outlook.com>
Mon, 22 Dec 2025 16:40:54 +0000 (00:40 +0800)
committerYuao Ma <c8ef@outlook.com>
Mon, 22 Dec 2025 17:23:16 +0000 (01:23 +0800)
commit94010a2af914ade3cfd791ac72c25df79efe299b
tree283816ac9c847f93f355b7dc3f72bd8870d4907b
parentac64ceb33bf05b69d4ab05a383d94652f1b5d0ca
c++: fix function body cloning when using implicit constexpr

When using implicit constexpr, we should not discard the function body, as it
can result in ICE during constant evaluation.

PR c++/123261

gcc/cp/ChangeLog:

* semantics.cc (expand_or_defer_fn_1): Use maybe_constexpr_fn.

gcc/testsuite/ChangeLog:

* g++.dg/ext/fimplicit-constexpr2.C: New test.
gcc/cp/semantics.cc
gcc/testsuite/g++.dg/ext/fimplicit-constexpr2.C [new file with mode: 0644]