public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94568] New: template specialization of equivalent nontype template argument involving member pointer considered distinct
@ 2020-04-12 20:19 msebor at gcc dot gnu.org
  2020-04-15 15:49 ` [Bug c++/94568] " msebor at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: msebor at gcc dot gnu.org @ 2020-04-12 20:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94568
           Summary: template specialization of equivalent nontype template
                    argument involving member pointer considered distinct
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: msebor at gcc dot gnu.org
  Target Milestone: ---

I believe the two definitions of XB below are the same and should be accepted. 
GCC for some reason not evident from the error message treats them as distinct.

$ cat t.C && gcc -O2 -S -Wall -std=c++2a t.C
struct A;
typedef int A::*MemPtr;

struct B { MemPtr p; };

static constexpr MemPtr mp { };

template <B> struct X { };

typedef X<B{{MemPtr{ }}}> XB;
typedef X<B{{mp}}>        XB;
t.C:11:27: error: conflicting declaration ‘typedef struct X<B{-1}> XB’
   11 | typedef X<B{{mp}}>        XB;
      |                           ^~
t.C:10:27: note: previous declaration as ‘typedef struct X<B{-1}> XB’
   10 | typedef X<B{{MemPtr{ }}}> XB;
      |                           ^~

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-16 22:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-12 20:19 [Bug c++/94568] New: template specialization of equivalent nontype template argument involving member pointer considered distinct msebor at gcc dot gnu.org
2020-04-15 15:49 ` [Bug c++/94568] " msebor at gcc dot gnu.org
2020-04-15 16:51 ` ensadc at mailnesia dot com
2020-11-16 22:17 ` redi at gcc dot gnu.org

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).