[C++ PATCH] PR c++/91165 follow-on tweak

Jason Merrill jason@redhat.com
Thu Dec 19 01:46:00 GMT 2019


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...

Tested x86_64-pc-linux-gnu, applying to trunk.

	* constexpr.c (cxx_eval_call_expression): Use
	unshare_expr_without_location.
---
 gcc/cp/constexpr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c
index 87d78d26728..b95da0f8342 100644
--- a/gcc/cp/constexpr.c
+++ b/gcc/cp/constexpr.c
@@ -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

base-commit: 05df605885dee7bf66bcafeed961aac9827bdb27
-- 
2.18.1



More information about the Gcc-patches mailing list