Clang incorrectly instantiates conditional-explicit even when constraints are not satisfied #60710
Labels
c++23
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
concepts
C++20 concepts
rejects-valid
In code like the following, Clang will instantiate the content of the conditional-explicit even when the constraint is not satisfied:
As a result, if
some-expression-involving-T
is not well-formed, Clang will issue a hard error even ifsome-constraint
is not satisfied, in which case one would have expected that the constructor is removed from the overload sets instead.Full reproducer:
Godbolt link: https://godbolt.org/z/7PjGqdjes
GCC and MSVC accept this code, Clang doesn't. This was discovered while trying to implement
pair-like
constructors for libc++.The text was updated successfully, but these errors were encountered: