mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-05 10:20:19 +08:00
decl.c (finish_destructor_body): Use the base destructor when destroying virtual bases.
* decl.c (finish_destructor_body): Use the base destructor when destroying virtual bases. From-SVN: r33562
This commit is contained in:
parent
738e281059
commit
5724a0e641
@ -1,3 +1,8 @@
|
||||
2000-04-30 Scott Snyder <snyder@fnal.gov>
|
||||
|
||||
* decl.c (finish_destructor_body): Use the base destructor when
|
||||
destroying virtual bases.
|
||||
|
||||
2000-04-30 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* expr.c (cplus_expand_expr): Preserve temporaries when expanding
|
||||
|
@ -13875,7 +13875,7 @@ finish_destructor_body ()
|
||||
TYPE_BINFO (current_class_type));
|
||||
finish_expr_stmt
|
||||
(build_scoped_method_call
|
||||
(current_class_ref, vb, complete_dtor_identifier,
|
||||
(current_class_ref, vb, base_dtor_identifier,
|
||||
NULL_TREE));
|
||||
}
|
||||
vbases = TREE_CHAIN (vbases);
|
||||
|
23
gcc/testsuite/g++.old-deja/g++.other/dtor9.C
Normal file
23
gcc/testsuite/g++.old-deja/g++.other/dtor9.C
Normal file
@ -0,0 +1,23 @@
|
||||
int i;
|
||||
|
||||
struct CC
|
||||
{
|
||||
virtual ~CC () { ++i; }
|
||||
};
|
||||
|
||||
class BB : virtual public CC
|
||||
{
|
||||
};
|
||||
|
||||
class AA : public virtual BB
|
||||
{
|
||||
};
|
||||
|
||||
int main ()
|
||||
{
|
||||
{
|
||||
AA xx;
|
||||
}
|
||||
if (i != 1)
|
||||
return 1;
|
||||
}
|
Loading…
Reference in New Issue
Block a user