From: Jason Merrill Date: Sat, 28 Aug 2021 02:59:48 +0000 (-0400) Subject: c++: use iloc_sentinel in another place X-Git-Tag: basepoints/gcc-13~5054 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=17dc903ed36ea0b6189d66a36d36e0c5ab803a7b;p=thirdparty%2Fgcc.git 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. --- diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c index 8be88dcfc24f..45adbab485ab 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