1 // { dg-do compile { target c++17 } } 2 // { dg-options "-fconcepts" } 3 4 template <class X> concept bool allocatable = requires{{new X}->X * }; 5 template <class X> concept bool semiregular = allocatable<X>; 6 template <class X> concept bool readable = requires{requires semiregular<X>}; 7 template <class> int weak_input_iterator = requires{{0}->readable}; 8 template <class X> bool input_iterator{weak_input_iterator<X>}; // { dg-warning "narrowing conversion" } 9 template <class X> bool forward_iterator{input_iterator<X>}; 10 template <class X> bool bidirectional_iterator{forward_iterator<X>}; 11 template <class X> 12 concept bool random_access_iterator{bidirectional_iterator<X>}; 13 void fn1(random_access_iterator); main()14int main() { fn1(0); } // { dg-error "" } 15