diff gcc/testsuite/g++.dg/cpp2a/concepts-lambda6.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gcc/testsuite/g++.dg/cpp2a/concepts-lambda6.C	Mon May 25 07:50:57 2020 +0900
@@ -0,0 +1,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); }