From cc497bc0e85d2e4e301408eda58d7c4812a8a908 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Fri, 12 Dec 2025 15:51:12 -0500 Subject: [PATCH] Don't pass member_access_p to cp_parser_splice_specifier --- gcc/cp/parser.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/gcc/cp/parser.cc b/gcc/cp/parser.cc index e4fb1731af9..0a95daa520d 100644 --- a/gcc/cp/parser.cc +++ b/gcc/cp/parser.cc @@ -6103,7 +6103,6 @@ cp_parser_next_tokens_can_start_splice_scope_spec_p (cp_parser *parser) static cp_expr cp_parser_splice_specifier (cp_parser *parser, bool template_p = false, - bool member_access_p = false, bool *targs_p = nullptr) { /* Get the location of the '[:'. */ @@ -6152,8 +6151,7 @@ cp_parser_splice_specifier (cp_parser *parser, bool template_p = false, /* For member access splice-specialization-specifier, try to wrap non-dependent splice for function template into a BASELINK so that cp_parser_template_id can handle it. */ - if (member_access_p - && parser->context->object_type + if (parser->context->object_type && DECL_FUNCTION_TEMPLATE_P (OVL_FIRST (expr)) && !dependent_type_p (parser->context->object_type)) { @@ -6250,8 +6248,7 @@ cp_parser_splice_expression (cp_parser *parser, bool template_p, parser->object_scope = NULL_TREE; parser->qualifying_scope = NULL_TREE; - cp_expr expr = cp_parser_splice_specifier (parser, template_p, - member_access_p, &targs_p); + cp_expr expr = cp_parser_splice_specifier (parser, template_p, &targs_p); /* And don't leave the scopes set, either. */ parser->scope = NULL_TREE; @@ -6423,8 +6420,7 @@ cp_parser_splice_scope_specifier (cp_parser *parser, bool typename_p, bool template_p) { bool targs_p = false; - cp_expr scope = cp_parser_splice_specifier (parser, template_p, false, - &targs_p); + cp_expr scope = cp_parser_splice_specifier (parser, template_p, &targs_p); const location_t loc = scope.get_location (); if (TREE_CODE (scope) == TYPE_DECL) scope = TREE_TYPE (scope);