summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/visibility28.C
blob: a7141ae5ea710ac502eb25bacfe71efb921a8ad3 (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
// { dg-do assemble  }
// GROUPS passed visibility
extern "C" int printf( const char *, ...);

class B {
public:
        B() { }
        virtual ~B() { printf( "B::~B\n"); }
};

class D : public B {
public:
        virtual ~D() { printf( "D::~D\n"); }
  void operator = ( int i) { this->~B(); }
};

int
main()
{
        D * pd = new D;
        B * pb = pd;
        delete pb;
        return 0;
}