1// { dg-do compile }
2
3bool foo();
4
5struct C
6{
7    C()
8    {
9        if (foo())
10            foo();
11    }
12};
13
14struct S
15{
16    struct dummy
17    {
18        int i_;
19    };
20    typedef int dummy::*bool_type;
21
22    operator bool_type() const
23    {
24        return foo() ? &dummy::i_ : 0;
25    }
26};
27
28int x;
29
30struct adaptor
31{
32    C c;
33
34    virtual void bar()
35    {
36        if (S())
37            x = 0;
38    }
39};
40
41int main()
42{
43    adaptor a;
44}
45
46