[VPlan] Add and use debug location for VPScalarCastRecipe.
[llvm-project.git] / libcxx / test / std / containers / sequences / list / list.cons / dtor.pass.cpp
blob8d04a0938a1b268bdfa5089c3ef3c81c9764dd7f
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 // <list>
11 // ~list()
13 // no emplace_back in C++03
14 // UNSUPPORTED: c++03
16 #include <list>
17 #include <cassert>
18 #include <set>
20 #include "test_macros.h"
23 std::set<int> destroyed;
25 struct Foo {
26 explicit Foo(int i) : value(i) { }
27 ~Foo() { destroyed.insert(value); }
28 int value;
31 int main(int, char**)
34 std::list<Foo> list;
35 list.emplace_back(1);
36 list.emplace_back(2);
37 list.emplace_back(3);
38 assert(destroyed.empty());
40 assert(destroyed.count(1) == 1);
41 assert(destroyed.count(2) == 1);
42 assert(destroyed.count(3) == 1);
44 return 0;