public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/99186] std::tuple compilation error when elements are specializations of template class declared with template < auto E > syntax with E being a enumerator of a enum
Date: Wed, 08 Dec 2021 15:53:01 +0000	[thread overview]
Message-ID: <bug-99186-4-MYWkpQq6wE@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-99186-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99186

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
And it doesn't matter whether enums are used:

template<int N, typename T, typename... U>
struct tuple_impl : tuple_impl<N + 1, U...>
{ };

template<int N, typename T>
struct tuple_impl<N, T>
{ };

template<typename T, typename U>
struct tuple : tuple_impl<0, T, U>
{ };

template<typename T, int N, typename... U>
void
get(const tuple_impl<N, T, U...>&)
{ }

template < auto >
struct S
{
    int i;
};

int main()
{
   tuple<S<1>,S<1U>> x;
   get<S<1U>>(x); // does not compile
}


The compiler doesn't correctly distinguish S<1> and S<1L>.

  parent reply	other threads:[~2021-12-08 15:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-21  1:52 [Bug c++/99186] New: " huili80 at gmail dot com
2021-02-22 16:44 ` [Bug c++/99186] " m.cencora at gmail dot com
2021-08-12 21:33 ` pinskia at gcc dot gnu.org
2021-12-08 14:13 ` marxin at gcc dot gnu.org
2021-12-08 15:38 ` redi at gcc dot gnu.org
2021-12-08 15:49 ` redi at gcc dot gnu.org
2021-12-08 15:53 ` redi at gcc dot gnu.org [this message]
2023-12-13 20:57 ` cvs-commit at gcc dot gnu.org
2023-12-16 17:15 ` ppalka at gcc dot gnu.org

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-99186-4-MYWkpQq6wE@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.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).