public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/c++-contracts] c++: don't add contracted fns to unparsed_funs.
@ 2022-11-01 11:43 Jason Merrill
0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2022-11-01 11:43 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:f5a360ff9bab5eb255ae86685f25c3e22fcfc554
commit f5a360ff9bab5eb255ae86685f25c3e22fcfc554
Author: Jason Merrill <jason@redhat.com>
Date: Fri Oct 28 12:08:06 2022 -0400
c++: don't add contracted fns to unparsed_funs.
They get their own late parse.
gcc/cp/ChangeLog:
* parser.cc (cp_parser_member_declaration): Don't add
fn with contracts to unparsed_funs_with_definitions.
Diff:
---
gcc/cp/parser.h | 1 +
gcc/cp/parser.cc | 6 ------
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/gcc/cp/parser.h b/gcc/cp/parser.h
index d31f007c1ef..1b6c359a4c0 100644
--- a/gcc/cp/parser.h
+++ b/gcc/cp/parser.h
@@ -318,6 +318,7 @@ struct GTY(()) cp_parser {
/* TRUE if the decl-specifier-seq preceding a declarator includes
the 'friend' specifier. This prevents attributes on friend function
declarations from being parsed in the complete class context. */
+ /* ??? Maybe use defer_guarded_contract_match instead? */
bool declaring_friend_p;
/* TRUE if we are presently parsing a template-argument-list. */
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index a911a660178..0f707b57c4c 100644
--- a/gcc/cp/parser.cc
+++ b/gcc/cp/parser.cc
@@ -27668,12 +27668,6 @@ cp_parser_member_declaration (cp_parser* parser)
initializer, /*init_const_expr_p=*/true,
asm_specification, attributes);
- /* If we've declared a member function with contracts, ensure we
- do late parsing for the contracts even if we have no function
- body to parse at that time. */
- if (DECL_DECLARES_FUNCTION_P (decl) && DECL_CONTRACTS (decl))
- vec_safe_push (unparsed_funs_with_definitions, decl);
-
if (parser->fully_implicit_function_template_p)
{
if (friend_p)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-01 11:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-01 11:43 [gcc/devel/c++-contracts] c++: don't add contracted fns to unparsed_funs 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).