gcc/testsuite/g++.dg/cpp2a/concepts-nondep2.C
raw| 1 | // PR c++/102412 |
| 2 | // { dg-do link { target c++20 } } |
| 3 | |
| 4 | template<class T, class U> concept C = __is_same(T, U); |
| 5 | |
| 6 | template<class T, bool = C<int, T>> void f(); |
| 7 | template<> void f<int, true>() { } |
| 8 | template<> void f<char, false>() { } |
| 9 | |
| 10 | template<bool = C<int, char>> void g(); |
| 11 | template<> void g<false>() { } |
| 12 | |
| 13 | template<bool = C<int, int>> void h(); |
| 14 | template<> void h<true>() { } |
| 15 | |
| 16 | int main() { |
| 17 | f<int>(); |
| 18 | f<char>(); |
| 19 | g(); |
| 20 | h(); |
| 21 | } |