PR c++/91165 follow-on tweak
authorJason Merrill <jason@redhat.com>
Thu, 19 Dec 2019 00:10:47 +0000 (19:10 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Thu, 19 Dec 2019 00:10:47 +0000 (19:10 -0500)
I talked in the PR about possibly stripping the location from the args in
the hash table, since if we use the cache the locations would be wrong, but
didn't actually do anything about that.  Then I noticed that there's already
unshare_expr_without_location...

* constexpr.c (cxx_eval_call_expression): Use
unshare_expr_without_location.

From-SVN: r279557

gcc/cp/ChangeLog
gcc/cp/constexpr.c

index 05ca5ec72a20f9bc748186dad7803f0f4ea46e94..19e1b881e2d15c4190d74f99b070e86a9793c0d0 100644 (file)
@@ -1,3 +1,9 @@
+2019-12-18  Jason Merrill  <jason@redhat.com>
+
+       PR c++/91165 follow-on tweak
+       * constexpr.c (cxx_eval_call_expression): Use
+       unshare_expr_without_location.
+
 2019-12-19  Julian Brown  <julian@codesourcery.com>
            Maciej W. Rozycki  <macro@codesourcery.com>
            Tobias Burnus  <tobias@codesourcery.com>
index 87d78d2672899b7cf2f2132c1204574405882b05..b95da0f83427ca837948075645d84792c7ec1c01 100644 (file)
@@ -2079,7 +2079,7 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,
                  /* Unshare args going into the hash table to separate them
                     from the caller's context, for better GC and to avoid
                     problems with verify_gimple.  */
-                 arg = unshare_expr (arg);
+                 arg = unshare_expr_without_location (arg);
                  TREE_VEC_ELT (bound, i) = arg;
                }
              /* Don't share a CONSTRUCTOR that might be changed.  This is not