This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/83692] Rejects valid constexpr with unrelated code fixing problem
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 25 Jan 2018 16:28:35 +0000
- Subject: [Bug c++/83692] Rejects valid constexpr with unrelated code fixing problem
- Auto-submitted: auto-generated
- References: <bug-83692-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83692
--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
So this works but might be too big a hammer. But I have no better ideas.
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -3663,6 +3663,10 @@ cxx_eval_store_expression (const constexpr_ctx *ctx,
tree t,
else
*valp = init;
+ /* We've rewritten a value of a temporary in this constexpr
+ context which might invalide a cached call. */
+ constexpr_call_table = NULL;
+
/* Update TREE_CONSTANT and TREE_SIDE_EFFECTS on enclosing
CONSTRUCTORs, if any. */
tree elt;