vec.c
13.7 KB
-
vec.h: add auto_delete_vec · e4d2203e
This patch adds a class auto_delete_vec<T>, a subclass of auto_vec <T *> that deletes all of its elements on destruction; it's used in many places in the analyzer patch kit. This is a crude way for a vec to "own" the objects it points to and clean up automatically (essentially a workaround for not being able to use unique_ptr, due to C++98). gcc/ChangeLog: * vec.c (class selftest::count_dtor): New class. (selftest::test_auto_delete_vec): New test. (selftest::vec_c_tests): Call it. * vec.h (class auto_delete_vec): New class template. (auto_delete_vec<T>::~auto_delete_vec): New dtor. From-SVN: r280027
David Malcolm committed