aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/torture/pr53336.C
blob: ab121945d81013a1b7a4ccd82b803e1d2a990f41 (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
// { dg-do compile }

bool foo();

struct C
{
    C()
    {
        if (foo())
            foo();
    }
};

struct S
{
    struct dummy
    {
        int i_;
    };
    typedef int dummy::*bool_type;

    operator bool_type() const
    {
        return foo() ? &dummy::i_ : 0;
    }
};

int x;

struct adaptor
{
    C c;

    virtual void bar()
    {
        if (S())
            x = 0;
    }
};

int main()
{
    adaptor a;
}