On 1/7/20 5:46 AM, Paolo Carlini wrote:
Hi,

On 06/01/20 21:47, Jason Merrill wrote:
On 1/2/20 4:23 AM, Paolo Carlini wrote:
@@ -19320,8 +19320,8 @@ tsubst_copy_and_build (tree t,
        tree op1 = tsubst (TREE_OPERAND (t, 1), args, complain, in_decl);
      tree op2 = RECUR (TREE_OPERAND (t, 2));
-    ret = build_new (&placement_vec, op1, op2, &init_vec,
-             NEW_EXPR_USE_GLOBAL (t),
+    ret = build_new (input_location, &placement_vec, op1, op2,

Hmm, using input_location bothers me even though it does have the right value in this function.  Let's use a local variable instead; maybe change the existing loc variable to save_loc and use the name loc for the location we want to use.

I see, I wondered about that myself: when I started working on these location issues I forwarded simple EXPR_LOCATION (t) in a few places, which worked just fine. Then I noticed that in many existing places we were exploiting the fact that input_location is changed on top and started using it myself too. I suppose some of those places too could be changed to simple EXPR_LOCATION (t), I can experiment with that.

Anyway, the below implements the save_loc bit and regtests fine on x86_64-linux, as usual.

OK.

Reply via email to