c++: Use iloc_sentinel in mark_use.
authorJason Merrill <jason@redhat.com>
Wed, 2 Sep 2020 21:53:24 +0000 (17:53 -0400)
committerJason Merrill <jason@redhat.com>
Fri, 4 Sep 2020 17:56:32 +0000 (13:56 -0400)
gcc/cp/ChangeLog:

* expr.c (mark_use): Use iloc_sentinel.

gcc/cp/expr.c

index a6ab96af614edd6ecc0f12ef8ed92626520d1e54..aa605931f97f7a81860ee925bbe5a30d9d4bb5a6 100644 (file)
@@ -139,9 +139,7 @@ mark_use (tree expr, bool rvalue_p, bool read_p,
                  break;
                }
            }
-         temp_override<location_t> l (input_location);
-         if (loc != UNKNOWN_LOCATION)
-           input_location = loc;
+         iloc_sentinel l (loc);
          expr = process_outer_var_ref (expr, tf_warning_or_error, true);
          if (!(TREE_TYPE (oexpr)
                && TYPE_REF_P (TREE_TYPE (oexpr))))