[libcxx-commits] [PATCH] D144694: [libc++][test] Silence MSVC deprecation warnings
Casey Carter via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Feb 23 18:50:06 PST 2023
CaseyCarter created this revision.
CaseyCarter added a reviewer: libc++.
CaseyCarter added a project: libc++.
Herald added a project: All.
CaseyCarter requested review of this revision.
Herald added 1 blocking reviewer(s): libc++.
... for implicitly-generated copy constructors and copy assignment operators.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D144694
Files:
libcxx/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp
libcxx/test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
Index: libcxx/test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
===================================================================
--- libcxx/test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
+++ libcxx/test/std/utilities/optional/optional.object/optional.object.mod/reset.pass.cpp
@@ -23,6 +23,9 @@
struct X
{
static bool dtor_called;
+ X() = default;
+ X(const X&) = default;
+ X& operator=(const X&) = default;
~X() {dtor_called = true;}
};
Index: libcxx/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp
===================================================================
--- libcxx/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp
+++ libcxx/test/std/utilities/optional/optional.object/optional.object.dtor/dtor.pass.cpp
@@ -29,6 +29,8 @@
public:
static bool dtor_called;
X() = default;
+ X(const X&) = default;
+ X& operator=(const X&) = default;
~X() {dtor_called = true;}
};
Index: libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
===================================================================
--- libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
+++ libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
@@ -31,6 +31,8 @@
constexpr X(int i, bool& dtor_called) : i_(i), dtor_called_(&dtor_called) {}
constexpr X(std::initializer_list<int> il, bool& dtor_called)
: i_(il.begin()[0]), j_(il.begin()[1]), dtor_called_(&dtor_called) {}
+ X(const X&) = default;
+ X& operator=(const X&) = default;
TEST_CONSTEXPR_CXX20 ~X() {*dtor_called_ = true;}
friend constexpr bool operator==(const X& x, const X& y)
@@ -60,6 +62,8 @@
Z(int i) : i_(i) {}
Z(std::initializer_list<int> il) : i_(il.begin()[0]), j_(il.begin()[1])
{ TEST_THROW(6);}
+ Z(const Z&) = default;
+ Z& operator=(const Z&) = default;
~Z() {dtor_called = true;}
friend bool operator==(const Z& x, const Z& y)
Index: libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
===================================================================
--- libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
+++ libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace.pass.cpp
@@ -40,6 +40,8 @@
static bool dtor_called;
Y() = default;
Y(int) { TEST_THROW(6);}
+ Y(const Y&) = default;
+ Y& operator=(const Y&) = default;
~Y() {dtor_called = true;}
};
Index: libcxx/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
===================================================================
--- libcxx/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
+++ libcxx/test/std/utilities/any/any.class/any.modifiers/emplace.pass.cpp
@@ -25,9 +25,11 @@
#include "test_macros.h"
struct Tracked {
- static int count;
- Tracked() {++count;}
- ~Tracked() { --count; }
+ static int count;
+ Tracked() { ++count; }
+ Tracked(Tracked const&) noexcept { ++count; }
+ Tracked& operator=(Tracked const&) = default;
+ ~Tracked() { --count; }
};
int Tracked::count = 0;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D144694.500036.patch
Type: text/x-patch
Size: 3391 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230224/d7a53b7e/attachment.bin>
More information about the libcxx-commits
mailing list