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