From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 827123858C20; Sat, 1 Oct 2022 17:19:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 827123858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664644773; bh=DGUWjYK+TuA7Ul9LYbBMtnoDvlN2qbU+uH4eObNpqWU=; h=From:To:Subject:Date:From; b=SnrVUiekIWOXg3b7yVXNvqtLxWYRbq6G5va1kjQj6dk0DGdLZvzfyIqAubJb5iqxt ns64DH1sLBB+RFyUV2CBtMlmy8IO0HRnE/4YbBuexiaYvWRp+t6iSQMHKt86lqgjHe h34TZHBFd5T/rRwDLa9S4igw0j6VAu3M9dzPLC7s= From: "iamsupermouse at mail dot ru" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107113] New: In function parameter list, `...` expanding a pack is accepted after `()` of a parameter declarator, but not before Date: Sat, 01 Oct 2022 17:19:33 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.1.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: iamsupermouse at mail dot ru X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D107113 Bug ID: 107113 Summary: In function parameter list, `...` expanding a pack is accepted after `()` of a parameter declarator, but not before Product: gcc Version: 12.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: iamsupermouse at mail dot ru Target Milestone: --- GCC rejects this code: template struct A { void Foo(P...()); }; A a; But accepts this: template struct A { void Foo(P()...); }; A a; Only the first snippet should compile, since `...` must be located immediat= ely before a parameter name (or a place where it would otherwise be located), as commonly seen in cases like `X &&... x`. Clang only accepts the first snippet.=