PR c++/79592 - missing explanation of invalid constexpr.
authorJason Merrill <jason@redhat.com>
Tue, 17 Dec 2019 21:46:40 +0000 (16:46 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 17 Dec 2019 21:46:40 +0000 (16:46 -0500)
commit4f05d85a22351720d860afb788cc5cdaffca92ca
treef09533c4151488583374ed223b5d904118a1fc44
parent9c7b2b0ba8687f92f7beab2e3615a1107c7063db
PR c++/79592 - missing explanation of invalid constexpr.

We changed months back to use the pre-generic form for constexpr evaluation,
but explain_invalid_constexpr_fn was still using DECL_SAVED_TREE.  This
mostly works, but misses some issues due to folding.  So with this patch we
save the pre-generic form of constexpr functions even when we know they
can't produce a constant result.

* constexpr.c (register_constexpr_fundef): Do store the body of a
template instantiation that is not potentially constant.
(explain_invalid_constexpr_fn): Look it up.
(cxx_eval_call_expression): Check fundef->result.

From-SVN: r279473
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/g++.dg/cpp0x/constexpr-nsdmi1.C [new file with mode: 0644]