Skip to content

Commit 0217eac

Browse files
committed
Add missing destructors to stubs
1 parent 81d9829 commit 0217eac

20 files changed

Lines changed: 42 additions & 12 deletions

File tree

cpp/common/test/includes/standard-library/any.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class any {
77
any();
88
any(const any &);
99
any(any &&);
10+
~any();
1011
template <typename T> any(T &&);
1112
};
1213

cpp/common/test/includes/standard-library/deque.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ template <class T, class Allocator = std::allocator<T>> class deque {
1818
deque(const deque &);
1919
deque(deque &&);
2020
deque(std::initializer_list<T>, const Allocator & = Allocator());
21+
~deque();
2122

2223
typedef __iterator<T> iterator;
2324
typedef __iterator<T> const_iterator;

cpp/common/test/includes/standard-library/forward_list.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ template <typename T, typename Alloc = std::allocator<T>> class forward_list {
1212
forward_list(const forward_list &);
1313
forward_list(forward_list &&);
1414
forward_list(std::initializer_list<T>);
15+
~forward_list();
1516
};
1617

1718
} // namespace std

cpp/common/test/includes/standard-library/fstream.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ class basic_fstream : public std::basic_iostream<CharT, Traits> {
1212
explicit basic_fstream(const char *s);
1313
basic_fstream(const basic_fstream &);
1414
basic_fstream(basic_fstream &&);
15+
virtual ~basic_fstream();
1516
// members
1617
bool is_open() const;
1718
void open(const string &s);

cpp/common/test/includes/standard-library/functional.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ template <class R, class... Args> class function<R(Args...)> {
119119
public:
120120
using result_type = R; // deprecated in C++17
121121
function();
122-
template <class F> function(F&& f);
122+
template <class F> function(F &&f);
123+
~function();
124+
123125
template <class F> function &operator=(F &&);
124126
};
125127

cpp/common/test/includes/standard-library/future.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class future {
1414
future();
1515
future(const future&);
1616
future(future&&);
17+
~future();
1718
};
1819

1920
template<typename T>
@@ -23,6 +24,7 @@ class shared_future {
2324
shared_future(const shared_future&);
2425
shared_future(shared_future&&);
2526
shared_future(future<T>&&);
27+
~shared_future();
2628
};
2729

2830
template<typename T>
@@ -31,6 +33,8 @@ class promise {
3133
promise();
3234
promise(const promise&);
3335
promise(promise&&);
36+
~promise();
37+
3438
future<T> get_future();
3539
};
3640

@@ -44,6 +48,7 @@ class packaged_task<R(Args...)> {
4448
packaged_task(const packaged_task&);
4549
packaged_task(packaged_task&&);
4650
template<typename F> packaged_task(F&&);
51+
~packaged_task();
4752
};
4853

4954
template<typename F, typename... Args>

cpp/common/test/includes/standard-library/list.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ template <typename T, typename Alloc = std::allocator<T>> class list {
1313
list(const list &);
1414
list(list &&);
1515
list(std::initializer_list<T>);
16+
~list();
1617
};
1718

1819
} // namespace std

cpp/common/test/includes/standard-library/map

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ public:
1414
multimap(const multimap&);
1515
multimap(multimap&&);
1616
multimap(std::initializer_list<std::pair<const _Key, _Tp>>);
17+
~multimap();
18+
1719
typedef std::pair<const _Key, _Tp> value_type;
1820
typedef std::__iterator<value_type> iterator;
1921
typedef std::__iterator<value_type> const_iterator;
@@ -32,6 +34,8 @@ public:
3234
map(const map&);
3335
map(map&&);
3436
map(std::initializer_list<std::pair<const _Key, _Tp>>);
37+
~map();
38+
3539
typedef std::pair<const _Key, _Tp> value_type;
3640
typedef std::__iterator<value_type> iterator;
3741
typedef std::__iterator<value_type> const_iterator;
@@ -41,4 +45,4 @@ public:
4145
const_iterator cbegin();
4246
const_iterator cend();
4347
};
44-
} // namespace std
48+
} // namespace std

cpp/common/test/includes/standard-library/memory.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@ template <typename T> class weak_ptr {
287287
weak_ptr(const weak_ptr &);
288288
weak_ptr(weak_ptr &&);
289289
weak_ptr(const shared_ptr<T> &);
290+
~weak_ptr();
290291
};
291292

292293
template <typename T, typename Alloc, typename... Args>

cpp/common/test/includes/standard-library/optional

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ public:
3636
constexpr optional(nullopt_t) noexcept;
3737
constexpr optional(const optional &other);
3838
constexpr optional(optional &&other) noexcept;
39+
40+
// Destructor
41+
~optional();
42+
3943
template <class U> constexpr explicit optional(const optional<U> &other);
4044
template <class U> constexpr explicit optional(optional<U> &&other);
4145
template <class... Args>
@@ -45,9 +49,6 @@ public:
4549
Args &&...args);
4650
template <class U = T> constexpr explicit optional(U &&value);
4751

48-
// Destructor
49-
~optional();
50-
5152
// Assignment operators
5253
optional &operator=(nullopt_t) noexcept;
5354
constexpr optional &operator=(const optional &other);

0 commit comments

Comments
 (0)