1 // RUN: %clang_cc1 -std=c++20 -verify %s
9 requires
requires(T
&t
) { requires
sizeof(t
) > 4; }
11 void specialization1();
15 requires
requires(T
&t
) { requires
sizeof(t
) > 8; }
17 void specialization2();
22 A
<char[5]>().specialization1();
23 A
<char[16]>(); // expected-error {{ambiguous partial specialization}}
24 // expected-note@10 {{partial specialization matches [with T = char[16]}}
25 // expected-note@16 {{partial specialization matches [with T = char[16]}}
28 // Check error messages when no overload with constraints matches.
31 requires
requires(T
&t
) { requires
sizeof(t
) < 4; }
36 requires
requires(T
&t
) { requires
sizeof(t
) > 4; }
41 requires
requires(T
&t
) { requires
sizeof(t
) > 8; }
46 // expected-error@-1 {{no matching function for call to 'foo'}}
47 // expected-note@30 {{candidate template ignored: constraints not satisfied}}
48 // expected-note@31 {{because 'sizeof (t) < 4' (4 < 4) evaluated to false}}
49 // expected-note@35 {{candidate template ignored: constraints not satisfied}}
50 // expected-note@36 {{because 'sizeof (t) > 4' (4 > 4) evaluated to false}}
51 // expected-note@40 {{candidate template ignored: constraints not satisfied}}
52 // expected-note@41 {{because 'sizeof (t) > 8' (4 > 8) evaluated to false}}
55 // expected-error@-1 {{call to 'foo' is ambiguous}}
56 // expected-note@35 {{candidate function}}
57 // expected-note@40 {{candidate function}}