gcc/testsuite/g++.dg/cpp2a/concepts-ctad3.C
raw| 1 | // PR c++/97679 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | template <bool V> struct A { |
| 5 | template <class T> struct B { |
| 6 | B(T) requires V; |
| 7 | template <class U> B(T, U) requires V || (__is_same(T, char) && __is_same(U, int)); |
| 8 | }; |
| 9 | }; |
| 10 | |
| 11 | A<true>::B x1(0); |
| 12 | A<false>::B x2(0); // { dg-error "deduction|no match" } |
| 13 | |
| 14 | A<true>::B y1(0, '0'); |
| 15 | A<false>::B y2(0, '0'); // { dg-error "deduction|no match" } |
| 16 | A<false>::B y3('0', 0); |