gcc/testsuite/g++.dg/cpp2a/concepts-requires11.C
raw| 1 | // PR c++/67018 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | template <typename T> |
| 5 | constexpr bool Val = true; |
| 6 | |
| 7 | template <class I> |
| 8 | concept InputIterator = requires (I i) { |
| 9 | requires Val<decltype(i++)>; |
| 10 | }; |
| 11 | |
| 12 | template <class I> |
| 13 | concept ForwardIterator = InputIterator<I> && true; |
| 14 | |
| 15 | template<InputIterator> |
| 16 | constexpr bool f() { return false; } |
| 17 | |
| 18 | template<ForwardIterator> |
| 19 | constexpr bool f() { return true; } |
| 20 | |
| 21 | static_assert(f<int*>()); |