2
2
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++11 -pedantic-errors -verify=expected %s
3
3
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++14 -pedantic-errors -verify=expected %s
4
4
// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++17 -pedantic-errors -verify=expected %s
5
- // RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++20 -pedantic-errors -verify=expected %s
6
- // RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++23 -pedantic-errors -verify=expected,since-cxx23 %s
7
- // RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++2c -pedantic-errors -verify=expected,since-cxx23,since-cxx26 %s
5
+ // RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++20 -pedantic-errors -verify=expected,since-cxx20 %s
6
+ // RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++23 -pedantic-errors -verify=expected,since-cxx20,since- cxx23 %s
7
+ // RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++2c -pedantic-errors -verify=expected,since-cxx20,since- cxx23,since-cxx26 %s
8
8
9
9
#if __cplusplus == 199711L
10
10
#define static_assert (...) __extension__ _Static_assert (__VA_ARGS__)
@@ -29,6 +29,35 @@ namespace std {
29
29
#endif
30
30
} // namespace std
31
31
32
+ namespace cwg2707 { // cwg2707: 20
33
+
34
+ #if __cplusplus >= 202002L
35
+
36
+ template <class T , unsigned N> struct A { // #cwg2707-A
37
+ T value[N];
38
+ };
39
+
40
+ template <typename ... T>
41
+ A (T...) -> A<int, sizeof...(T)> requires (sizeof ...(T) == 2); // #cwg2707-guide-A
42
+
43
+ // Brace elision is not allowed for synthesized CTAD guides if the array size
44
+ // is value-dependent.
45
+ // So this should pick up our explicit deduction guide.
46
+ A a = {1 , 2 };
47
+
48
+ A b = {3 , 4 , 5 };
49
+ // since-cxx20-error@-1 {{no viable constructor or deduction guide}}
50
+ // since-cxx20-note@#cwg2707-A {{candidate function template not viable}}
51
+ // since-cxx20-note@#cwg2707-A {{implicit deduction guide}}
52
+ // since-cxx20-note@#cwg2707-guide-A {{constraints not satisfied}}
53
+ // since-cxx20-note@#cwg2707-guide-A {{because 'sizeof...(T) == 2' (3 == 2) evaluated to false}}
54
+ // since-cxx20-note@#cwg2707-A {{candidate function template not viable}}
55
+ // since-cxx20-note@#cwg2707-A {{implicit deduction guide}}
56
+
57
+ #endif
58
+
59
+ } // namespace cwg2707
60
+
32
61
namespace cwg2718 { // cwg2718: 2.7
33
62
struct B {};
34
63
struct D ;
@@ -200,32 +229,3 @@ static_assert(false, f().s);
200
229
// since-cxx26-error@-1 {{static assertion failed: Hello}}
201
230
#endif
202
231
} // namespace cwg2798
203
-
204
- namespace cwg2707 { // cwg2707: 20
205
-
206
- #if __cplusplus >= 202002L
207
-
208
- template <class T , unsigned N> struct A {
209
- T value[N];
210
- };
211
-
212
- template <typename ... T>
213
- A (T...) -> A<int, sizeof...(T)> requires (sizeof ...(T) == 2);
214
-
215
- // Brace elision is not allowed for synthesized CTAD guides if the array size
216
- // is value-dependent.
217
- // So this should pick up our explicit deduction guide.
218
- A a = {1 , 2 };
219
-
220
- A b = {3 , 4 , 5 };
221
- // expected-error@-1 {{no viable constructor or deduction guide}} \
222
- // expected-note@-13 {{candidate function template not viable}} \
223
- // expected-note@-13 {{implicit deduction guide}} \
224
- // expected-note@-8 {{constraints not satisfied}} \
225
- // expected-note@-8 {{because 'sizeof...(T) == 2' (3 == 2) evaluated to false}} \
226
- // expected-note@-13 {{candidate function template not viable}} \
227
- // expected-note@-13 {{implicit deduction guide}}
228
-
229
- #endif
230
-
231
- } // namespace cwg2707
0 commit comments