[PATCH] c++: make __is_constructible work with paren-init of aggrs [PR94149]
Jonathan Wakely
jwakely@redhat.com
Tue Apr 21 12:39:15 GMT 2020
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?
Here's the library change needed to uncomment the FIXMEs in
paren-init24.C
Bootstrapped and tested on powerpc64le-linux, I plan to commit this
to master today.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.txt
Type: text/x-patch
Size: 5819 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20200421/b6117a6a/attachment.bin>
More information about the Libstdc++
mailing list