2003-01-06 Mark Mitchell <mark@codesourcery.com>
+ PR c++/9165
+ * decl2.c (build_cleanup): Mark the object as used.
+
* pt.c (retrieve_local_specialization): Revert 2003-01-05 change.
(hash_local_specialization): New function.
(register_local_specialization): Revert 2003-01-05 change.
DECL_INTERFACE_KNOWN (decl) = 1;
}
+/* Return an expression that performs the destruction of DECL, which
+ must be a VAR_DECL whose type has a non-trivial destructor, or is
+ an array whose (innermost) elements have a non-trivial destructor. */
+
tree
build_cleanup (tree decl)
{
tree temp;
tree type = TREE_TYPE (decl);
+ /* This function should only be called for declarations that really
+ require cleanups. */
+ my_friendly_assert (!TYPE_HAS_TRIVIAL_DESTRUCTOR (type), 20030106);
+
+ /* 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
2003-01-06 Mark Mitchell <mark@codesourcery.com>
- * testsuite/g++.dg/abi/bitfield9.C: New test.
+ PR c++/9165
+ * g++.dg/warn/Wunused-3.C: New test.
+
+ * g++.dg/abi/bitfield9.C: New test.
PR c++/9189
* g++.dg/parse/defarg3.C: New test.