c++: Small location tweak
authorJason Merrill <jason@redhat.com>
Wed, 15 Sep 2021 23:01:14 +0000 (19:01 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 16 Sep 2021 03:42:59 +0000 (23:42 -0400)
As Marek suggested.

gcc/cp/ChangeLog:

* constexpr.c (cxx_eval_outermost_constant_expr): Use
protected_set_expr_location.

gcc/cp/constexpr.c

index d3c075c..8a5dd06 100644 (file)
@@ -7502,8 +7502,7 @@ cxx_eval_outermost_constant_expr (tree t, bool allow_non_constant,
 
   /* Remember the original location if that wouldn't need a wrapper.  */
   if (location_t loc = EXPR_LOCATION (t))
-    if (CAN_HAVE_LOCATION_P (r))
-      SET_EXPR_LOCATION (r, loc);
+    protected_set_expr_location (r, loc);
 
   return r;
 }