blob: c2a60900b353ee03217a4d9785fab3444ad02693 (
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
35
|
// PR c++/69889
// { dg-do compile { target c++11 } }
// { dg-additional-options "-Wno-return-type" }
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;
|