From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A457E3858C50; Mon, 11 Dec 2023 07:28:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A457E3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1702279725; bh=dy9mG6XBKgmi1HW1VJk+T+A3U8zTbsRfrQmAvLx+5x0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XjtT+egn4+CNvogYxa90LmvgFjgBXPdOsZZV6A3foawZY9J6CyPsGEcRbXtX/Zp8A dXkFUEqxjBF0sMccwpwSXQ2kgW8nhcEIDI0ZS+OUjG/RSYPsm36IvzwtOfDulF3iZ+ m9cSDM4JaxDD9hFh1UzTWYSuWhId492uiKHl6jfY= From: "dblaikie at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack Date: Mon, 11 Dec 2023 07:28:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: symtab X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: dblaikie at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D17272 --- Comment #18 from David Blaikie --- (In reply to Hannes Domani from comment #17) > (In reply to David Blaikie from comment #16) > > For types you can't have more than one pack, I think: > > $ clang++-tot -std=3Dc++2a pack_type.cpp=20 > > pack_type.cpp:1:22: error: template parameter pack must be the last tem= plate > > parameter > > 1 | template > > | ^ > > 1 error generated. > >=20 > > But you can have multiple packs in a function template - and I think it= 'd be > > good to represent it correctly - since there can be two functions, for > > instance, with the same parameters but packed differently (eg: > > `template void f1();` you could have > > `f1` where the int is in the first pack (and the second pack is em= pty) > > or the other way around, and those are distinct overloads) >=20 > Could you share an example where the 2nd pack is not empty, because I cou= ld > not figure out how to do it? I don't think you can explicitly specify such arguments, they can only be provided via template argument deduction, like this example: https://godbolt.org/z/377YT7dfb Notice that the two `f1` calls call distinct functions: _Z2f1IJEJiEEv2t1IJDpT_EES0_IJDpT0_EE _Z2f1IJiEJEEv2t1IJDpT_EES0_IJDpT0_EE or, demangled: void f1<, int>(t1<>, t1) void f1(t1, t1<>) --=20 You are receiving this mail because: You are on the CC list for the bug.=