blob: 0fcf980be6bdaaa72632eb481b259b6c4762b5c3 (
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
|
// { dg-do assemble }
struct
Foo
{
public:
typedef void* (*copier_fn)(void const*);
void foo() const;
void bar(char const*, void const*) const;
private:
struct
Bar
{
char const* key;
void const* item;
};
};
void
Foo::foo() const
{
Bar* cp = 0;
copier_fn copyfn = 0;
bar(cp->key, cp->item);
bar(cp->key, (copyfn) ? (*copyfn)(cp) : 0);
bar(cp->key, (copyfn) ? (*copyfn)(0) : 0);
bar(cp->key, (copyfn) ? (*copyfn)(0) : cp->item);
bar(cp->key, (copyfn) ? (*copyfn)(cp) : cp->item);
}
|