Skip to content

Commit 9ca749d

Browse files
Revert " [3/N] Fix cppcoreguidelines-special-member-functions warnings (#138796)"
This reverts commit 7cb3cef. Reverted #138796 on behalf of https://github.com/wdvr due to reverting since this started failing a windows test ([comment](#138796 (comment)))
1 parent 633dcf1 commit 9ca749d

18 files changed

+8
-56
lines changed

aten/src/ATen/TensorIterator.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,6 +1483,8 @@ FastSetupType TensorIteratorBase::compute_fast_setup_type(const TensorIteratorCo
14831483
return FastSetupType::NONE;
14841484
}
14851485

1486+
TensorIteratorBase::TensorIteratorBase() = default;
1487+
14861488
void TensorIteratorBase::build(TensorIteratorConfig& config) {
14871489
// populate some persistent configuration fields
14881490
is_reduction_ = config.is_reduction_;

aten/src/ATen/TensorIterator.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ struct TORCH_API TensorIteratorBase : public impl::MetaBase {
250250
using PtrVector = SmallVector<char*, 4>;
251251
using StrideVector = SmallVector<int64_t, 6>;
252252

253+
TensorIteratorBase();
253254
void build(TensorIteratorConfig&);
254255

255256
// The inner-loop function operates on the fastest moving dimension. It
@@ -787,9 +788,6 @@ class TORCH_API TensorIteratorConfig final {
787788
TensorIteratorConfig() = default;
788789

789790
C10_DISABLE_COPY_AND_ASSIGN(TensorIteratorConfig);
790-
TensorIteratorConfig(TensorIteratorConfig&&) = default;
791-
TensorIteratorConfig& operator=(TensorIteratorConfig&&) = default;
792-
~TensorIteratorConfig() = default;
793791

794792
/// Construction
795793
// Stores input/output Tensors without incrementing the reference count.
@@ -999,8 +997,6 @@ struct TORCH_API SplitUntil32Bit {
999997
iterator() = default;
1000998
iterator(const TensorIteratorBase& iter);
1001999
iterator(iterator&&) = default;
1002-
iterator& operator=(iterator&&) = default;
1003-
~iterator() = default;
10041000

10051001
// Guaranteed to be a TensorIterator proper!
10061002
TensorIterator& operator*() const;

aten/src/ATen/code_template.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ namespace at::jit {
1919
struct TemplateEnv {
2020
TemplateEnv() = default;
2121
TemplateEnv(TemplateEnv& parent) : parent(&parent) {}
22-
TemplateEnv(TemplateEnv&&) = delete;
2322
TemplateEnv& operator=(const TemplateEnv& parent) = delete;
24-
TemplateEnv& operator=(TemplateEnv&& parent) = delete;
25-
~TemplateEnv() = default;
2623

2724
using string_list = std::vector<std::string>;
2825

aten/src/ATen/core/Array.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,10 @@ struct Array {
2323
C10_HOST_DEVICE Array() = default;
2424
C10_HOST_DEVICE Array(const Array&) = default;
2525
C10_HOST_DEVICE Array& operator=(const Array&) = default;
26-
C10_HOST_DEVICE Array(Array&&) = default;
27-
C10_HOST_DEVICE Array& operator=(Array&&) = default;
28-
C10_HOST_DEVICE ~Array() = default;
2926
#else
3027
Array() = default;
3128
Array(const Array&) = default;
3229
Array& operator=(const Array&) = default;
33-
Array(Array&&) = default;
34-
Array& operator=(Array&&) = default;
35-
~Array() = default;
3630
#endif
3731
static constexpr int size() {
3832
return size_;

aten/src/ATen/core/Dict.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ class DictEntryRef final {
8383
static_assert(std::is_constructible_v<Value, Value_>, "Wrong type for the value argument of setValue()");
8484
iterator_->second = Value(std::forward<Value_>(value));
8585
}
86-
~DictEntryRef() = default;
8786

8887
private:
8988
// allow copying and moving, but only our friends (i.e. the Dict class) can do

aten/src/ATen/core/Formatting.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,16 @@ inline std::ios_base& defaultfloat(std::ios_base& __base) {
5050
//saves/restores number formatting inside scope
5151
struct FormatGuard {
5252
FormatGuard(std::ostream & out)
53-
: out(out) {
53+
: out(out), saved(nullptr) {
5454
saved.copyfmt(out);
5555
}
5656
~FormatGuard() {
5757
out.copyfmt(saved);
5858
}
59-
FormatGuard(const FormatGuard&) = delete;
60-
FormatGuard(FormatGuard&&) = delete;
61-
FormatGuard& operator=(const FormatGuard&) = delete;
62-
FormatGuard& operator=(FormatGuard&&) = delete;
6359
private:
6460
// NOLINTNEXTLINE(cppcoreguidelines-avoid-const-or-ref-data-members)
6561
std::ostream & out;
66-
std::ios saved{nullptr};
62+
std::ios saved;
6763
};
6864

6965
std::ostream& operator<<(std::ostream & out, const DeprecatedTypeProperties& t) {

aten/src/ATen/core/List.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ class ListElementReference final {
8888

8989
ListElementReference(const ListElementReference&) = delete;
9090
ListElementReference& operator=(const ListElementReference&) = delete;
91-
~ListElementReference() = default;
9291

9392
private:
9493
ListElementReference(Iterator iter)
@@ -274,9 +273,6 @@ class List final {
274273

275274
List(const List&) = default;
276275
List& operator=(const List&) = default;
277-
List(List&&) = default;
278-
List& operator=(List&&) = default;
279-
~List() = default;
280276

281277
/**
282278
* Create a new List pointing to a deep copy of the same data.

aten/src/ATen/core/List_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
using namespace c10;
55

6-
// NOLINTBEGIN(performance-move-const-arg, bugprone-use-after-move, *analyzer*Move)
6+
// NOLINTBEGIN(performance-move-const-arg, bugprone-use-after-move)
77
TEST(ListTestIValueBasedList, givenEmptyList_whenCallingEmpty_thenReturnsTrue) {
88
List<string> list;
99
EXPECT_TRUE(list.empty());
@@ -1162,4 +1162,4 @@ TEST(ListTest, toTypedList) {
11621162
genericList = impl::toList(std::move(stringList));
11631163
EXPECT_THROW(c10::impl::toTypedList<int64_t>(std::move(genericList)), c10::Error);
11641164
}
1165-
// NOLINTEND(performance-move-const-arg, bugprone-use-after-move, *analyzer*Move)
1165+
// NOLINTEND(performance-move-const-arg, bugprone-use-after-move)

aten/src/ATen/core/NamedTensor.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ struct TORCH_API NoNamesGuard {
8282
NoNamesGuard() : prev_mode(NamesMode::is_enabled()) {
8383
NamesMode::set_enabled(false);
8484
}
85-
NoNamesGuard(const NoNamesGuard&) = delete;
86-
NoNamesGuard(NoNamesGuard&&) = delete;
87-
NoNamesGuard& operator=(const NoNamesGuard&) = delete;
88-
NoNamesGuard& operator=(NoNamesGuard&&) = delete;
8985
~NoNamesGuard() {
9086
if (initialized) {
9187
reset();

aten/src/ATen/core/PythonFallbackKernel.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ struct StashTLSOnEntryGuard {
3535
StashTLSOnEntryGuard(): saved_(tls_on_entry.value()) {
3636
tls_on_entry = std::nullopt;
3737
}
38-
StashTLSOnEntryGuard(const StashTLSOnEntryGuard&) = delete;
39-
StashTLSOnEntryGuard(StashTLSOnEntryGuard&&) = delete;
40-
StashTLSOnEntryGuard& operator=(const StashTLSOnEntryGuard&) = delete;
41-
StashTLSOnEntryGuard& operator=(StashTLSOnEntryGuard&&) = delete;
4238

4339
~StashTLSOnEntryGuard() {
4440
TORCH_INTERNAL_ASSERT(!tls_on_entry.has_value());

0 commit comments

Comments
 (0)