public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "dblaikie at gmail dot com" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack
Date: Mon, 11 Dec 2023 07:28:44 +0000 [thread overview]
Message-ID: <bug-17272-4717-r1lPdGPXql@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-17272-4717@http.sourceware.org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=17272
--- Comment #18 from David Blaikie <dblaikie at gmail dot com> ---
(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=c++2a pack_type.cpp
> > pack_type.cpp:1:22: error: template parameter pack must be the last template
> > parameter
> > 1 | template<typename... T1s, typename... T2s>
> > | ^
> > 1 error generated.
> >
> > 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<typename... T1s, typename ... T2s> void f1();` you could have
> > `f1<int>` where the int is in the first pack (and the second pack is empty)
> > or the other way around, and those are distinct overloads)
>
> Could you share an example where the 2nd pack is not empty, because I could
> 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<int>)
void f1<int>(t1<int>, t1<>)
--
You are receiving this mail because:
You are on the CC list for the bug.
prev parent reply other threads:[~2023-12-11 7:28 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-14 20:44 [Bug symtab/17272] New: DW_TAG_GNU_template_parameter_pack dje at google dot com
2023-01-14 0:24 ` [Bug symtab/17272] DW_TAG_GNU_template_parameter_pack ed at catmur dot uk
2023-01-14 1:57 ` tromey at sourceware dot org
2023-01-14 12:58 ` ssbssa at sourceware dot org
2023-01-14 13:34 ` ed at catmur dot uk
2023-01-14 13:37 ` ed at catmur dot uk
2023-01-15 22:44 ` ed at catmur dot uk
2023-01-16 23:37 ` tromey at sourceware dot org
2023-02-04 16:29 ` ed at catmur dot uk
2023-03-22 23:54 ` dblaikie at gmail dot com
2023-07-17 21:02 ` tromey at sourceware dot org
2023-07-17 21:04 ` tromey at sourceware dot org
2023-07-17 21:13 ` tromey at sourceware dot org
2023-07-18 23:20 ` dblaikie at gmail dot com
2023-12-10 17:01 ` ssbssa at sourceware dot org
2023-12-11 7:28 ` dblaikie at gmail dot com [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-17272-4717-r1lPdGPXql@http.sourceware.org/bugzilla/ \
--to=sourceware-bugzilla@sourceware.org \
--cc=gdb-prs@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).