diff options
author | Scott Snyder <snyder@fnal.gov> | 2000-05-01 06:01:33 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2000-05-01 06:01:33 +0000 |
commit | 5724a0e6410d5f68761acc1ba338cce11d3677c8 (patch) | |
tree | 71fcbb94fe174827a5b7315aba6879343d9f38b8 | |
parent | 738e281059b7bd0f19aec2f0a08d00598c9a7469 (diff) | |
download | gcc-5724a0e6410d5f68761acc1ba338cce11d3677c8.zip gcc-5724a0e6410d5f68761acc1ba338cce11d3677c8.tar.gz gcc-5724a0e6410d5f68761acc1ba338cce11d3677c8.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/dtor9.C | 23 |
3 files changed, 29 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ff7b02d..df7b07e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index deb9e8f..d9385f5 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -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); diff --git a/gcc/testsuite/g++.old-deja/g++.other/dtor9.C b/gcc/testsuite/g++.old-deja/g++.other/dtor9.C new file mode 100644 index 0000000..6f0d5ac --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/dtor9.C @@ -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; +} |