From 17dc903ed36ea0b6189d66a36d36e0c5ab803a7b Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 27 Aug 2021 22:59:48 -0400 Subject: [PATCH] c++: use iloc_sentinel in another place Another place we can use iloc_sentinel instead of explicitly saving and restoring input_location. gcc/cp/ChangeLog: * constexpr.c (explain_invalid_constexpr_fn): Use iloc_sentinel. --- gcc/cp/constexpr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 8be88dc..45adbab 100644 --- a/gcc/cp/constexpr.c +++ b/gcc/cp/constexpr.c @@ -942,7 +942,6 @@ explain_invalid_constexpr_fn (tree fun) { static hash_set *diagnosed; tree body; - location_t save_loc; /* Only diagnose defaulted functions, lambdas, or instantiations. */ if (!DECL_DEFAULTED_FN (fun) && !LAMBDA_TYPE_P (CP_DECL_CONTEXT (fun)) @@ -957,7 +956,7 @@ explain_invalid_constexpr_fn (tree fun) /* Already explained. */ return; - save_loc = input_location; + iloc_sentinel ils = input_location; if (!lambda_static_thunk_p (fun)) { /* Diagnostics should completely ignore the static thunk, so leave @@ -985,7 +984,6 @@ explain_invalid_constexpr_fn (tree fun) cx_check_missing_mem_inits (DECL_CONTEXT (fun), body, true); } } - input_location = save_loc; } /* Objects of this type represent calls to constexpr functions -- 2.7.4