diff options
author | Jason Merrill <jason@redhat.com> | 2021-08-27 22:59:48 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2021-08-31 12:17:44 -0400 |
commit | 17dc903ed36ea0b6189d66a36d36e0c5ab803a7b (patch) | |
tree | 4a9758123a645db88cb7e1437474357416455471 | |
parent | 9aeadd8c319d5d940fa4dc91a393fc2959d27719 (diff) | |
download | gcc-17dc903ed36ea0b6189d66a36d36e0c5ab803a7b.zip gcc-17dc903ed36ea0b6189d66a36d36e0c5ab803a7b.tar.gz gcc-17dc903ed36ea0b6189d66a36d36e0c5ab803a7b.tar.bz2 |
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.
-rw-r--r-- | gcc/cp/constexpr.c | 4 |
1 files changed, 1 insertions, 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<tree> *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 |