1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
// { dg-options "-std=c++17 -fconcepts" } // Test that standard conversions are checked with // implicit conversion constraints. template<typename T, typename U> concept bool C() { return requires(T& t) { {t} -> U&; }; } struct B { }; class D : B { }; int main() { static_assert(C<D, B>(), ""); // { dg-error "failed" } }