std::is_constructible on incomplete types

The behavior is undefined.

[meta.unary.prop]

template <class T, class... Args> struct is_constructible;

T and all types in the parameter pack Args shall be complete types, (possibly cv-qualified) void, or arrays of unknown bound.

That's a precondition of the meta-function. A contract that your code violates. libc++ is being generous by notifying you.


Mind you, that putting that precondition there and leaving it undefined otherwise is for a reason. A program where two points of instantiation of a template have different meanings is ill-formed NDR. The only sane course of action is demand complete types. And after all, that's when the trait is most useful anyway.


Your code causes undefined behavior.

Cppreference states:

template< class T, class... Args > struct is_constructible;

T and all types in the parameter pack Args shall each be a complete type, (possibly cv-qualified) void, or an array of unknown bound. Otherwise, the behavior is undefined.


Your code has undefined behavior. Per [meta.unary.prop] table 47 std::is_constructible requires

T and all types in the template parameter pack Args shall be complete types, cv void, or arrays of unknown bound.

emphasis mine