Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/lambda/lambda-constexpr1.C

raw
1 // PR c++/94453
2 // { dg-do compile { target c++11 } }
3
4 void *ay();
5 template <typename f> f ay() { return *static_cast<f *>(ay()); }
6 template <typename h>
7 void bf() {
8 ay<h>()();
9 }
10 struct az {
11 template <typename h>
12 az(h);
13 using bk = void (*)();
14 bk bl;
15 };
16 template <typename h>
17 az::az(h) { bl = bf<h>; }
18 struct A {};
19 void da(az);
20 void di(A, int);
21 void dk(A, az, az);
22 void b() {
23 int data = 0;
24 auto n = [] {};
25 constexpr auto p = A{};
26 auto q = [=] { di(p, data); };
27 da([=] { dk(p, n, q); });
28 }