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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
This is a bad interaction between sharing a constructor for an array and
stripping trailing zero-initializers, which is why this test works with
{{{1}}}.

While here you can initialize D from {{}}, you can't initialize it from {{0}}. 
So when we drop that 0, we suddenly allow both F() overloads, making this
ambiguous.

Slightly tweaked testcase:

template <int N> struct A { typedef int _Type[N]; };
template <int N> struct B { typename A<N>::_Type _M_elems; };
class C { };
struct D {
  D(C);
};

struct F {
  F(B<2>);
  F(D);
};
F fn1() { return {{{0}}}; }

Reply via email to