aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr68184.C
blob: d0c7c84910ce502230f0ab69d9f94e4c94369e64 (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 run }
namespace {
struct IFoo { virtual void foo() = 0; };
struct IBar { virtual void bar() = 0; };

struct FooBar : private IBar, private IFoo
{
    void call_foo()
    {
        try
        {
            static_cast<IFoo*>(this)->foo();
        }
        catch( ... ) {}
    }
    void foo() { throw 1; }
    void bar()  {}
};

void test()
{
    FooBar foobar;
    foobar.call_foo();
}
}
int main()
{
    test();
    return 0;
}