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

--- Comment #7 from Jan Schultke <janschultke at googlemail dot com> ---
> Note I think this part is missed by clang here:
> 8.5.4 List-initialization [dcl.init.list] p.3.2
> Otherwise, if T is a character array and the initializer list has a single
> element that is an appropriately-typed string literal (8.5.2),
> initialization is performed as described in that section.

Arguing that Clang "missed" that would be putting the cart before the horse. We
don't know whether the string literal is appropriately typed for the
initialization of an array before we have deduced the size of an array. What
matters is what N deduces to (it's 1 in this case) and whether an implicit
conversion sequence can be formed (from {"awoo"} to const char(&)[1]) with such
deduction, so that the constructor is a viable candidate for overload
resolution.

There is some more wording intended to make this work, [over.ics.list] p4:

> Otherwise, if the parameter type is a character array
> and the initializer list has a single element
> that is an appropriately-typed string-literal ([dcl.init.string]),
> the implicit conversion sequence is the identity conversion.

However, as I've said, all of this is preceded by [over.match.funcs.general]
p8:

> In each case where a candidate is a function template,
> candidate function template specializations are generated
> using template argument deduction ([temp.over], [temp.deduct]).

Reply via email to