aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2022-10-28 12:08:06 -0400
committerJason Merrill <jason@redhat.com>2022-10-31 12:00:30 -0400
commitf5a360ff9bab5eb255ae86685f25c3e22fcfc554 (patch)
tree23101667d7fe885505b2cdb2786e82ce823b7872
parent5080aec5f3f0eae334883c099f93070e6c3a5b64 (diff)
downloadgcc-f5a360ff9bab5eb255ae86685f25c3e22fcfc554.zip
gcc-f5a360ff9bab5eb255ae86685f25c3e22fcfc554.tar.gz
gcc-f5a360ff9bab5eb255ae86685f25c3e22fcfc554.tar.bz2
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.
-rw-r--r--gcc/cp/parser.cc6
-rw-r--r--gcc/cp/parser.h1
2 files changed, 1 insertions, 6 deletions
diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc
index a911a66..0f707b5 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)
diff --git a/gcc/cp/parser.h b/gcc/cp/parser.h
index d31f007c..1b6c359 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. */