diff options
author | Mark Mitchell <mark@codesourcery.com> | 2007-06-01 00:44:36 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2007-06-01 00:44:36 +0000 |
commit | 46a9e5217844297332b2e5e0c568d4448f365e96 (patch) | |
tree | 420cff63564965826ce919df9219fa10d126d563 /gcc/cp/decl2.c | |
parent | fa2185f0c8be353357878e67a0bb610ab7a9a704 (diff) | |
download | gcc-46a9e5217844297332b2e5e0c568d4448f365e96.tar.gz |
decl.c (get_atexit_fn_ptr_type): New function.
* decl.c (get_atexit_fn_ptr_type): New function.
(get_atexit_node): Use it.
(start_cleanup_fn): Likewise.
(register_dtor_fn): Use the object's destructor, instead of a
separate cleanup function, where possible.
* cp-tree.h (CPTI_ATEXIT_FN_PTR_TYPE): New enumerator.
(atexit_fn_ptr_type_node): New macro.
* decl2.c (build_cleanup): Use build_address.
* g++.dg/init/cleanup3.C: New test.
From-SVN: r125253
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 9eb6fd5c1ce..3e18c4a4c19 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2190,10 +2190,7 @@ build_cleanup (tree decl) if (TREE_CODE (type) == ARRAY_TYPE) temp = decl; else - { - cxx_mark_addressable (decl); - temp = build1 (ADDR_EXPR, build_pointer_type (type), decl); - } + temp = build_address (decl); temp = build_delete (TREE_TYPE (temp), temp, sfk_complete_destructor, LOOKUP_NORMAL|LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR, 0); |