https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79592
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> --- Author: jason Date: Tue Dec 17 21:46:40 2019 New Revision: 279473 URL: https://gcc.gnu.org/viewcvs?rev=279473&root=gcc&view=rev Log: 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. Added: trunk/gcc/testsuite/g++.dg/cpp0x/constexpr-nsdmi1.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/constexpr.c