This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/83692] Rejects valid constexpr with unrelated code fixing problem


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;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]