gcc/testsuite/g++.dg/cpp2a/concepts-requires36.C
raw| 1 | // PR c++/111419 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | template<class F> |
| 5 | concept invocable = requires(F& f) { f(); }; |
| 6 | |
| 7 | template<class F> |
| 8 | concept deref_invocable = requires(F& f) { *f(); }; |
| 9 | |
| 10 | struct Incomplete; |
| 11 | |
| 12 | template<class T> |
| 13 | struct Holder { T t; }; |
| 14 | |
| 15 | static_assert(invocable<Holder<Incomplete>& ()>); |
| 16 | static_assert(deref_invocable<Holder<Incomplete>* ()>); |