[Bug c++/92067] __is_constructible(incomplete_type) should make the program ill-formed

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 23 16:18:39 GMT 2022


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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Jason Merrill from comment #3)
> Hmm? but the standard says that a precondition for std::is_constructible is
> the type being complete, and we enforce that with a static_assert (since
> PR71579).  Why would it be a problem for the builtin to enforce it as well?

...having tried it, one reason not to is that it makes the diagnostic worse:
instead of one understandable error from the static_assert, we also get the
compiler error, and then another one from trying to access ::value in the class
we failed to instantiate.

Do other standard library implementations depend on the compiler to diagnose
this?


More information about the Gcc-bugs mailing list