Debian Codegraph @

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

raw
1 // PR c++/79488
2 // { dg-do compile { target c++11 } }
3
4 int f();
5 static int g __attribute__((__weakref__("f")));
6
7 template <typename Fn> struct res {
8 static Fn val();
9 using type = decltype(val()()); // { dg-error "no match for call" }
10 };
11
12 template <typename Fn> struct A {
13 template <typename T> void set_result(T) {}
14
15 virtual void run() {
16 auto boundfn = []() -> typename res<Fn>::type{};
17 set_result(boundfn);
18 }
19 };
20
21 struct F {
22 void operator()() &;
23 };
24
25 A<F> t;