aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-lambda6.C
blob: 0b7c04562e9bc29fd544407a294be475736a7200 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// PR c++/94645
// { dg-do compile { target concepts } }

struct unordered_map {
  int cend() const noexcept;
};

template <typename a> concept HasMapInterface = requires(a t) { t.cend(); };

template <typename Mapper> requires HasMapInterface<decltype(Mapper::map())>
struct l {
  friend void foo(l opt) { ([]() {})(); }
};

struct p {
  static unordered_map map();
};

void g(l<p> *y) { foo(*y); }