gcc/testsuite/g++.dg/cpp2a/concepts-lambda6.C
raw| 1 | // PR c++/94645 |
| 2 | // { dg-do compile { target concepts } } |
| 3 | |
| 4 | struct unordered_map { |
| 5 | int cend() const noexcept; |
| 6 | }; |
| 7 | |
| 8 | template <typename a> concept HasMapInterface = requires(a t) { t.cend(); }; |
| 9 | |
| 10 | template <typename Mapper> requires HasMapInterface<decltype(Mapper::map())> |
| 11 | struct l { |
| 12 | friend void foo(l opt) { ([]() {})(); } |
| 13 | }; |
| 14 | |
| 15 | struct p { |
| 16 | static unordered_map map(); |
| 17 | }; |
| 18 | |
| 19 | void g(l<p> *y) { foo(*y); } |