public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Jason Merrill <jason@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-3259] c++: use iloc_sentinel in another place Date: Tue, 31 Aug 2021 16:18:08 +0000 (GMT) [thread overview] Message-ID: <20210831161808.CE821385780F@sourceware.org> (raw) 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
reply other threads:[~2021-08-31 16:18 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210831161808.CE821385780F@sourceware.org \ --to=jason@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).