public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-3259] c++: use iloc_sentinel in another place
@ 2021-08-31 16:18 Jason Merrill
  0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2021-08-31 16:18 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:17dc903ed36ea0b6189d66a36d36e0c5ab803a7b

commit r12-3259-g17dc903ed36ea0b6189d66a36d36e0c5ab803a7b
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Aug 27 22:59:48 2021 -0400

    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:
---
 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 8be88dcfc24..45adbab485a 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-08-31 16:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-31 16:18 [gcc r12-3259] c++: use iloc_sentinel in another place Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).