From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id EE0133858D38; Tue, 6 Feb 2024 17:34:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EE0133858D38 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707240860; bh=FPdUdoieXeitiT1uVgzWvMPV8J2oZeXBfVfVMgStPIA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IVjoX7BZN/MF7mEiSzVHkG82zzFj4ieHn/WtyIdtXOpg9ACGTnAvgTm+9eCKGYkoT yOYkj+Q4ZC92oMkmI0Yg9FeQVPJTqCAcz19OlDpmIlTWQQY8i/2ftt+R4JOCrOFkPw wPbNtJJtXO+zHLwRBLuxdo8OxFheeI9OtSJ0vgvs= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/113788] Deducing this is broken with structured binding Date: Tue, 06 Feb 2024 17:34:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: accepts-invalid, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D113788 Jakub Jelinek changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #3 from Jakub Jelinek --- Yeah, given that this[opt] is not in the grammar as declaration specifier b= ut only in parameter-declaration, I'd go with: --- parser.cc.jj2 2024-01-17 10:34:45.337660930 +0100 +++ parser.cc 2024-02-06 18:31:35.587193903 +0100 @@ -2088,7 +2088,9 @@ enum /* When parsing of the noexcept-specifier should be delayed. */ CP_PARSER_FLAGS_DELAY_NOEXCEPT =3D 0x40, /* When parsing a consteval declarator. */ - CP_PARSER_FLAGS_CONSTEVAL =3D 0x80 + CP_PARSER_FLAGS_CONSTEVAL =3D 0x80, + /* When parsing a parameter declaration. */ + CP_PARSER_FLAGS_PARAMETER =3D 0x100 }; /* This type is used for parameters and variables which hold @@ -16342,7 +16344,7 @@ cp_parser_decl_specifier_seq (cp_parser* /* Special case for "this" specifier, indicating a parm is an xobj p= arm. The "this" specifier must be the first specifier in the declaratio= n, after any attributes. */ - if (token->keyword =3D=3D RID_THIS) + if (token->keyword =3D=3D RID_THIS && (flags & CP_PARSER_FLAGS_PARAM= ETER)) { cp_lexer_consume_token (parser->lexer); if (token !=3D first_specifier) @@ -25607,7 +25609,7 @@ cp_parser_parameter_declaration (cp_pars /* Parse the declaration-specifiers. */ cp_token *decl_spec_token_start =3D cp_lexer_peek_token (parser->lexer); cp_parser_decl_specifier_seq (parser, - flags, + flags | CP_PARSER_FLAGS_PARAMETER, &decl_specifiers, &declares_class_or_enum);=