|
1 |
| -// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify |
| 1 | +// RUN: %clang_cc1 -std=c++2a -x c++ %s -verify=expected,cxx20 |
| 2 | +// RUN: %clang_cc1 -std=c++2c -x c++ %s -verify |
| 3 | + |
2 | 4 |
|
3 | 5 | template<auto T, decltype(T) U>
|
4 | 6 | concept C1 = sizeof(U) >= 4;
|
@@ -59,19 +61,22 @@ static_assert(foo<int, 'a'>() == 2);
|
59 | 61 |
|
60 | 62 | namespace packs {
|
61 | 63 |
|
62 |
| -template<auto T, decltype(T)... U> |
63 |
| -concept C1 = (sizeof(U) && ...) >= 4; |
| 64 | +template<auto T, decltype(T) U> |
| 65 | +concept C1 = sizeof(U) >= 4; |
64 | 66 |
|
65 |
| -template<typename Y, char... V> |
66 |
| -concept C2 = (C1<Y{}, V> && ...); |
| 67 | +template<typename Y, char V> |
| 68 | +concept C2 = C1<Y{}, V>; |
67 | 69 |
|
68 | 70 | template<char... W>
|
69 |
| -constexpr int foo() requires (C2<int, W> && ...) { return 1; } |
| 71 | +constexpr int foo() requires (C2<int, W> && ...) { return 1; } // #packs-cand1 |
70 | 72 |
|
71 | 73 | template<char... X>
|
72 |
| -constexpr int foo() requires (C1<1, X> && ...) && true { return 2; } |
| 74 | +constexpr int foo() requires (C1<1, X> && ...) && true { return 2; } // #packs-cand2 |
73 | 75 |
|
74 | 76 | static_assert(foo<'a'>() == 2);
|
| 77 | +// cxx20-error@-1{{call to 'foo' is ambiguous}} |
| 78 | +// cxx20-note@#packs-cand1 {{candidate function}} |
| 79 | +// cxx20-note@#packs-cand2 {{candidate function}} |
75 | 80 |
|
76 | 81 | }
|
77 | 82 |
|
|
0 commit comments