1 // { dg-do compile { target c++17 } } 2 // { dg-options "-fconcepts" } 3 4 template<typename T, typename U> 5 struct is_same 6 { 7 static constexpr bool value = false; 8 }; 9 10 template<typename T> 11 struct is_same<T, T> 12 { 13 static constexpr bool value = true; 14 }; 15 16 template<class T, class U> 17 concept bool Same = is_same<T, U>::value; 18 19 template<typename T> 20 concept bool C1 = true; 21 22 template<typename T, typename U> 23 concept bool C2 = true; 24 25 template<typename T> 26 concept bool C3() { return true; } 27 28 template<typename T, typename U> 29 concept bool C4() { return true; } 30 31 C1 c1 = 0; 32 C2<int> c2 = 0; 33 C3 c3 = 0; 34 C4<int> c4 = 0; 35 Same<int> s1 = 'a'; // { dg-error "does not satisfy|is_same" } 36