On 09/04/20 17:00 -0400, Marek Polacek wrote:
In C++20 this is well-formed:
using T = int[2];
T t(1, 2);
which means that std::is_constructible_v<int[2], int, int> should be true.
But constructible_expr immediately returned the error_mark_node when it
saw a list with more than one element. To give accurate results in
C++20, we have to try initializing the aggregate from a parenthesized list of
values.
To not repeat the same mistake as in c++/93790, if there's only one
element, I'm trying {} only when () didn't succeed. is_constructible5.C
verifies this.
Jon, in paren-init24.C std::is_nothrow_constructible_v doesn't work,
I'm getting
error: invalid 'static_cast' from type 'int' to type 'int [1]'
and
error: functional cast to array type 'int [2]'
Are these the issues you had in mind when we spoke earlier today?
Yes, exactly. I need to add a partial specialization for arrays, which
will just check if the element type is nothrow-constuctible from each
of the argument types.