aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-conv10.C
blob: 8e806c849ae342945081877eb48321919fcc489f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// PR c++/69889
// { dg-do compile { target c++11 } }

template <typename F> struct Tag {
  static void fp() { f()(0); }
  static F f() {}
};

struct Dispatch {
  template <typename F> Dispatch(F&&) : f(Tag<F>::fp) {}
  void (*f)();
};

struct Empty { Empty(Empty&&); };

struct Value {
  Value();
  template <typename U> Value(U);
  void call(Dispatch);
  Empty e;
};

struct EmptyValue {
  EmptyValue(EmptyValue&&);
  EmptyValue();
};

struct User {
  User() {
    Value().call([](Value) { return EmptyValue(); });
  }
};

User user;