// There were assertion failures in both parse and codegen, which are fixed in clang 11.
// UNSUPPORTED: gcc, clang-4, clang-5, clang-6, clang-7, clang-8, clang-9, clang-10
+// UNSUPPORTED: c++03
#include <memory>
#include <cassert>
//
// With trivial-abi, expect_1 will see shared == 1 because shared_val is
// incremented before get_val returns.
- expect_1(&shared, get_val(std::make_unique<Node>(&shared)));
+ expect_1(&shared, get_val(std::unique_ptr<Node>(new Node(&shared))));
// Check that the shared-value is still 1.
expect_1(&shared, true);
// There were assertion failures in both parse and codegen, which are fixed in clang 11.
// UNSUPPORTED: gcc, clang-4, clang-5, clang-6, clang-7, clang-8, clang-9, clang-10
+// UNSUPPORTED: c++03
#include <memory>
#include <cassert>
char shared_buf[3] = {'0', '0', '0'};
int cur_idx = 0;
- func(A(shared_buf, &cur_idx), std::make_unique<B>(shared_buf, &cur_idx),
+ func(A(shared_buf, &cur_idx), std::unique_ptr<B>(new B(shared_buf, &cur_idx)),
C(shared_buf, &cur_idx));
// With trivial_abi, the std::unique_ptr<B> arg is always destructed first.
__attribute__((noinline)) std::unique_ptr<Node> make_val(void** local_addr) {
call_something();
- auto ret = std::make_unique<Node>();
+ auto ret = std::unique_ptr<Node>(new Node);
// Capture the local address of ret.
*local_addr = &ret;