hppa: Fix ICE caused by mismatched predicate and constraint in xmpyu patterns
[official-gcc.git] / gcc / testsuite / g++.dg / concepts / pr67595.C
blob33122d2ddb0ad1eb7c112fbec09ca15862e6b486
1 // { dg-do compile { target c++17_only } }
2 // { dg-options "-fconcepts-ts" }
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-prune-output "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>}; // { dg-error "constant" }
13 void fn1(random_access_iterator);
14 int main() { fn1(0); }  // { dg-error "" }