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

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #6)
> (In reply to Piotr Nycz from comment #0)
> > It looks that std library code start requiring this to pass:
> > std::is_nothrow_constructible<A&&, A>...
> 
> Indeed, that's what the standard requires (Clang and MSVC reject this the
> same way). The standard also says that using traits like is_constructible
> requires complete types.
> 
> However, that's clearly silly for is_constructible<A&&, A> because we know
> that reference binding is valid for any A whether it's complete or not.
> 
> This is the subject of:
> https://cplusplus.github.io/LWG/issue2939

We can fix this in std::tuple by adding && to the source objects in all
is_constructible and is_convertible conditions. Or we could fix it in the type
traits themselves.

But I think it would be best to fix it in the compiler, so that we always allow
directly binding T&& or const T& to T, even if T is incomplete. Otherwise we'll
be playing whackamole all over the library.

Reply via email to