* g++.dg/init/dtor1.C: New test.
From-SVN: r53033
This commit is contained in:
parent
0d6d689229
commit
76ccdb3c4a
@ -1,3 +1,7 @@
|
||||
2002-05-01 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* g++.dg/init/dtor1.C: New test.
|
||||
|
||||
2002-05-02 Aldy Hernandez <aldyh@redhat.com>
|
||||
|
||||
* gcc.dg/altivec-8.c: New.
|
||||
|
27
gcc/testsuite/g++.dg/init/dtor1.C
Normal file
27
gcc/testsuite/g++.dg/init/dtor1.C
Normal file
@ -0,0 +1,27 @@
|
||||
// { dg-do run }
|
||||
|
||||
extern "C" void abort ();
|
||||
|
||||
int d = 2;
|
||||
|
||||
struct B
|
||||
{
|
||||
int x;
|
||||
B (int i) : x (i) { }
|
||||
~B () { if (d-- != x) abort (); }
|
||||
};
|
||||
|
||||
struct A
|
||||
: public B
|
||||
{
|
||||
A () : B (0), x1(1), x2(2) {}
|
||||
B x1;
|
||||
B x2;
|
||||
};
|
||||
|
||||
|
||||
int main ()
|
||||
{
|
||||
A a;
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user