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

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
Another test case, this one not involving pointers.  Somehow the form of the
initializer (= 0 vs { }) makes a difference.

$ cat t.C && gcc -O2 -c -Wall -std=c++2a t.C
template <C> struct D { };

constexpr const int i0 = 0;
constexpr const int i_{ };

static_assert (i0 == i_);

typedef D<C{ { 0, 1 } }>   DC01;
typedef D<C{ { i0, 1 } }>  DC01;
typedef D<C{ { i_, 1 } }>  DC01;
t.C:11:28: error: conflicting declaration ‘typedef struct D<C{int [2]{0, 1}}>
DC01’
   11 | typedef D<C{ { i_, 1 } }>  DC01;
      |                            ^~~~
t.C:10:28: note: previous declaration as ‘typedef struct D<C{int [2]{0, 1}}>
DC01’
   10 | typedef D<C{ { i0, 1 } }>  DC01;
      |                            ^~~~

Reply via email to