From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 43F40385841A; Wed, 27 Mar 2024 00:20:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 43F40385841A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711498818; bh=VxliiLtpS57cZ5ZCnxAWCX1GdSjng5E5z7nGsKV6uaQ=; h=From:To:Subject:Date:From; b=cN52LYvtU/x9OVEkAFVps+Jwn/6ejN4Jfb1VwJDecn5MjL5Uyhi8LNz3EQoIf4p1i eVsYUT9k1zGEhf1lENLgbBp9LhVVcmof/i7C6sijZ8iJJLuqqmzjNh1I/7sES7lduV 1fnq97QRWBGDJmS+lyhJhqrYcCPMDaLrJV2NeslM= From: "christoph.schied at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/114491] New: incorrect identifier namespacing with variadic templates Date: Wed, 27 Mar 2024 00:20:17 +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: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: christoph.schied 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 attachments.created 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=3D114491 Bug ID: 114491 Summary: incorrect identifier namespacing with variadic templates Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: christoph.schied at gmail dot com Target Milestone: --- Created attachment 57818 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D57818&action=3Dedit same source code as posted in the description The following code fails to compile with g++, however it works with clang. I tried various versions of gcc in godbolt (https://godbolt.org/z/xqfoc4Yce) using std=3Dc++17 and std=3Dc++20 and the code fails to compile on all vers= ions. It appears that the dependent type T gets confused with the template argument = of the function. template void works() { typename A::T var; } template void broken() { typename A::T var; /* A::T and T seem to clash */ } results in: : In function 'void broken()': :10:19: error: parameter packs not expanded with '...': 10 | typename A::T var; /* A::T and T seem to clash */ | ^~~ :10:19: note: 'T'=