Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang tidy 19 #177

Merged
merged 15 commits into from
Dec 6, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[clang-tidy-19] Enable performance-unnecessary-copy-initialization
```
error: local copy 'var2' of the variable 'var1' is never modified;
consider avoiding the copy
performance-unnecessary-copy-initialization,-warnings-as-errors]
 1951 |         const MapOfInstanceCounterType var2{var1};
      |                                        ^
      |                                       &

```
alexkaratarakis committed Dec 5, 2024
commit 835030d11b29a239866612747c51911fd92e1bd4
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -74,7 +74,6 @@ Checks: >
-bugprone-easily-swappable-parameters,
-bugprone-switch-missing-default-case,
-bugprone-unchecked-optional-access,
-performance-unnecessary-copy-initialization,
-readability-container-size-empty,
-bugprone-crtp-constructor-accessibility,
-bugprone-return-const-ref-from-parameter,
4 changes: 2 additions & 2 deletions test/enum_map_test.cpp
Original file line number Diff line number Diff line change
@@ -1846,8 +1846,8 @@ TYPED_TEST_P(EnumMapInstanceCheckFixture, EnumMapInstanceCheck)
ASSERT_EQ(2, InstanceCounterType::counter);

{ // IMPORTANT SCOPE, don't remove.
const MapOfInstanceCounterType var2{var1};
(void)var2;
MapOfInstanceCounterType var2{var1};
var2.begin()->second.mock_mutator();
ASSERT_EQ(4, InstanceCounterType::counter);
}
ASSERT_EQ(2, InstanceCounterType::counter);
4 changes: 2 additions & 2 deletions test/fixed_circular_deque_test.cpp
Original file line number Diff line number Diff line change
@@ -2543,8 +2543,8 @@ TYPED_TEST_P(FixedCircularDequeInstanceCheckFixture, FixedCircularDequeInstanceC
ASSERT_EQ(2, InstanceCounterType::counter);

{ // IMPORTANT SCOPE, don't remove.
const CircularDequeOfInstanceCounterType var2{var1};
(void)var2;
CircularDequeOfInstanceCounterType var2{var1};
var2.back().mock_mutator();
ASSERT_EQ(4, InstanceCounterType::counter);
}
ASSERT_EQ(2, InstanceCounterType::counter);
4 changes: 2 additions & 2 deletions test/fixed_deque_test.cpp
Original file line number Diff line number Diff line change
@@ -2305,8 +2305,8 @@ TYPED_TEST_P(FixedDequeInstanceCheckFixture, FixedDequeInstanceCheck)
ASSERT_EQ(2, InstanceCounterType::counter);

{ // IMPORTANT SCOPE, don't remove.
const DequeOfInstanceCounterType var2{var1};
(void)var2;
DequeOfInstanceCounterType var2{var1};
var2.back().mock_mutator();
ASSERT_EQ(4, InstanceCounterType::counter);
}
ASSERT_EQ(2, InstanceCounterType::counter);
4 changes: 2 additions & 2 deletions test/fixed_list_test.cpp
Original file line number Diff line number Diff line change
@@ -2200,8 +2200,8 @@ TYPED_TEST_P(FixedListInstanceCheckFixture, FixedListInstanceCheck)
ASSERT_EQ(2, InstanceCounterType::counter);

{ // IMPORTANT SCOPE, don't remove.
const ListOfInstanceCounterType var2{var1};
(void)var2;
ListOfInstanceCounterType var2{var1};
var2.back().mock_mutator();
ASSERT_EQ(4, InstanceCounterType::counter);
}
ASSERT_EQ(2, InstanceCounterType::counter);
4 changes: 2 additions & 2 deletions test/fixed_map_test.cpp
Original file line number Diff line number Diff line change
@@ -1948,8 +1948,8 @@ TYPED_TEST_P(FixedMapInstanceCheckFixture, FixedMapInstanceCheck)
ASSERT_EQ(4, InstanceCounterType::counter);

{ // IMPORTANT SCOPE, don't remove.
const MapOfInstanceCounterType var2{var1};
(void)var2;
MapOfInstanceCounterType var2{var1};
var2.begin()->second.mock_mutator();
ASSERT_EQ(8, InstanceCounterType::counter);
}
ASSERT_EQ(4, InstanceCounterType::counter);
4 changes: 2 additions & 2 deletions test/fixed_unordered_map_test.cpp
Original file line number Diff line number Diff line change
@@ -1831,8 +1831,8 @@ TYPED_TEST_P(FixedUnorderedMapInstanceCheckFixture, FixedUnorderedMapInstanceChe
ASSERT_EQ(4, InstanceCounterType::counter);

{ // IMPORTANT SCOPE, don't remove.
const MapOfInstanceCounterType var2{var1};
(void)var2;
MapOfInstanceCounterType var2{var1};
var2.begin()->second.mock_mutator();
ASSERT_EQ(8, InstanceCounterType::counter);
}
ASSERT_EQ(4, InstanceCounterType::counter);
4 changes: 2 additions & 2 deletions test/fixed_vector_test.cpp
Original file line number Diff line number Diff line change
@@ -2195,8 +2195,8 @@ TYPED_TEST_P(FixedVectorInstanceCheckFixture, FixedVectorInstanceCheck)
ASSERT_EQ(2, InstanceCounterType::counter);

{ // IMPORTANT SCOPE, don't remove.
const VectorOfInstanceCounterType var2{var1};
(void)var2;
VectorOfInstanceCounterType var2{var1};
var2.back().mock_mutator();
ASSERT_EQ(4, InstanceCounterType::counter);
}
ASSERT_EQ(2, InstanceCounterType::counter);