Don't pass member_access_p to cp_parser_splice_specifier

This commit is contained in:
Marek Polacek
2025-12-12 15:51:12 -05:00
parent d8655c0b94
commit cc497bc0e8

View File

@@ -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);