diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-31 15:44:58 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-10-31 15:44:58 +0000 |
commit | 9ede1ce4e04eae865c7a08d1cc184c1562dba5cd (patch) | |
tree | b7c74e14c0dcd2d71253f0e3e742eb1aa28fc881 /gcc/cp/decl2.c | |
parent | 46f8ecc66f71478f9813219f6823c5f20557f797 (diff) | |
download | gcc-9ede1ce4e04eae865c7a08d1cc184c1562dba5cd.tar.gz |
* decl.c (cxx_maybe_build_cleanup): Always set LOOKUP_NONVIRTUAL.
* decl2.c (build_cleanup): Just call cxx_maybe_build_cleanup.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204265 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index d776471607c..18e0e526d20 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -2722,26 +2722,9 @@ import_export_decl (tree decl) tree build_cleanup (tree decl) { - tree temp; - tree type = TREE_TYPE (decl); - - /* This function should only be called for declarations that really - require cleanups. */ - gcc_assert (!TYPE_HAS_TRIVIAL_DESTRUCTOR (type)); - - /* Treat all objects with destructors as used; the destructor may do - something substantive. */ - mark_used (decl); - - if (TREE_CODE (type) == ARRAY_TYPE) - temp = decl; - else - temp = build_address (decl); - temp = build_delete (TREE_TYPE (temp), temp, - sfk_complete_destructor, - LOOKUP_NORMAL|LOOKUP_NONVIRTUAL|LOOKUP_DESTRUCTOR, 0, - tf_warning_or_error); - return temp; + tree clean = cxx_maybe_build_cleanup (decl, tf_warning_or_error); + gcc_assert (clean != NULL_TREE); + return clean; } /* Returns the initialization guard variable for the variable DECL, |