From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2E8203858C20; Sat, 1 Oct 2022 17:05:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E8203858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664643931; bh=uBCTT1od6EDZ/p8EKxKypfqPDZ01KcVBqiLqXk09DkY=; h=From:To:Subject:Date:From; b=BavTEBLvJS8NuJvILnlQNuOBRCNi6aqh3yfinHiIOTrgCqy2pwByAsfDgVwNtRS5p 2HiioE+Wai6A805tvBgeNL3RLAk/5G+TAbqV7W5hPLw18a+MwMcdNpsV0ayku2zjYF lDFxIKcJLZj71KrI/28mair9f2j8yiBThML2U8WU= From: "jlame646 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107111] New: GCC accepts invalid program involving function declaration with pack expansion Date: Sat, 01 Oct 2022 17:05:30 +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: jlame646 at gmail dot com 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=3D107111 Bug ID: 107111 Summary: GCC accepts invalid program involving function declaration with pack expansion Product: gcc Version: 12.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jlame646 at gmail dot com Target Milestone: --- The following program is incorrectly accepted by gcc. Demo: https://godbolt.org/z/rvfqzo5YW ``` template=20 struct C=20 { T v(V()...);; }; int main() { C c; //works with gcc but rejected in clang=20 C c2; //same here: works with gcc but rejected in clang } ``` This is invalid because the construct `V()...` is actually equivalent to `V(),...`. So `V` is not expanded and this must be rejected.=