blob: d1ef012b91559086abc7712efd41e6660fc5aa64 (
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
// { dg-do run }
// Avoid -pedantic-error default
// { dg-options "" }
// Make sure the functions referenced by various forms of
// address-taking are marked as used and compiled in.
static void ac() {}
void a() {
ac[0](); // { dg-warning "arithmetic" }
}
static void bc() {}
void b() {
(&*&*&*&bc)();
}
template <typename U> U cc() {}
void (*c())() {
return cc;
}
template <typename T>
struct x {
void a(int);
template <typename U> static U a(x*) {}
static void a(long) {}
static void a(void *) {}
static void a() {
void (*p0)(void*) = x().a;
p0(0);
void (*p1)(long) = a;
p1(0);
void (*p2)() = a;
p2();
void (*p3)(x*) = a;
p3(0);
}
};
struct z {
void a(int);
template <typename U> static U a(z*) {}
static void a(long) {}
static void a(void *) {}
static void a() {
void (*p0)(void*) = z().a;
p0(0);
void (*p1)(long) = a;
p1(0);
void (*p2)() = a;
p2();
void (*p3)(z*) = a;
p3(0);
}
};
int main(int argc, char *argv[]) {
if (argc > 1) {
x<void>().a();
z().a();
}
}
|