gcc/testsuite/g++.dg/cpp2a/concepts-pr66091.C
raw| 1 | // PR c++/66091 |
| 2 | // { dg-do compile { target c++17 } } |
| 3 | // { dg-additional-options "-fconcepts" } |
| 4 | |
| 5 | template<typename T> |
| 6 | concept C1 = |
| 7 | requires() { typename T::type1; }; |
| 8 | |
| 9 | |
| 10 | template<typename T> |
| 11 | concept C2 = |
| 12 | C1<T> && requires() { typename T::type2; }; |
| 13 | |
| 14 | |
| 15 | template<C1 T> |
| 16 | struct S { |
| 17 | S& operator++() { return *this; } |
| 18 | S& operator++() requires (C2<T>) { return *this; } |
| 19 | }; |