Skip to content

Commit cb78eab

Browse files
committed
modernize-use-equals-default
1 parent 76f21cb commit cb78eab

46 files changed

Lines changed: 122 additions & 99 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-tidy

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ Checks:
2626
- 'modernize-*'
2727
- '-modernize-use-integer-sign-comparison'
2828
- '-modernize-use-nodiscard'
29-
- '-modernize-use-equals-default'
3029
- '-modernize-return-braced-init-list'
3130
- '-modernize-use-auto'
3231
# END REMOVE ME

c/parallel/test/test_radix_sort.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct TestParameters
3737
static constexpr bool m_descending = descending;
3838
static constexpr bool m_overwrite_okay = overwrite_okay;
3939

40-
constexpr TestParameters() {}
40+
constexpr TestParameters() = default;
4141

4242
bool is_descending() const
4343
{

c/parallel/test/test_segmented_sort.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct TestParameters
4949
static constexpr bool m_descending = descending;
5050
static constexpr bool m_overwrite_okay = overwrite_okay;
5151

52-
constexpr TestParameters() {}
52+
constexpr TestParameters() = default;
5353

5454
constexpr bool is_descending() const
5555
{

c2h/include/c2h/checked_allocator.cuh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public:
160160
using other = checked_cuda_allocator<U>;
161161
};
162162

163-
_CCCL_HOST_DEVICE checked_cuda_allocator() {}
163+
checked_cuda_allocator() = default;
164164

165165
_CCCL_HOST_DEVICE checked_cuda_allocator(const checked_cuda_allocator& other)
166166
: base(other)
@@ -173,7 +173,7 @@ public:
173173

174174
checked_cuda_allocator& operator=(const checked_cuda_allocator&) = default;
175175

176-
_CCCL_HOST_DEVICE ~checked_cuda_allocator() {}
176+
~checked_cuda_allocator() = default;
177177
};
178178

179179
struct checked_host_memory_resource final : public THRUST_NS_QUALIFIER::mr::new_delete_resource_base

cub/cub/block/block_load_to_shared.cuh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ private:
228228
class token_impl
229229
{
230230
friend struct BlockLoadToShared;
231-
_CCCL_DEVICE_API _CCCL_FORCEINLINE token_impl() {} // ctor must have a body to avoid token_impl{} to compile
231+
_CCCL_DEVICE_API _CCCL_FORCEINLINE token_impl() {} // NOLINT(modernize-use-equals-default) ctor must have a body to
232+
// avoid token_impl{} to compile
232233

233234
// NOLINTBEGIN(modernize-use-equals-delete)
234235
token_impl(const token_impl&) = delete;

cub/cub/thread/thread_operators.cuh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ struct ScanBySegmentOp
167167
ScanOpT op;
168168

169169
/// Constructor
170-
_CCCL_HOST_DEVICE _CCCL_FORCEINLINE ScanBySegmentOp() {}
170+
_CCCL_FORCEINLINE ScanBySegmentOp() = default;
171171

172172
/// Constructor
173173
_CCCL_HOST_DEVICE _CCCL_FORCEINLINE ScanBySegmentOp(ScanOpT op)
@@ -301,7 +301,7 @@ struct ReduceBySegmentOp
301301
ReductionOpT op;
302302

303303
/// Constructor
304-
_CCCL_HOST_DEVICE _CCCL_FORCEINLINE ReduceBySegmentOp() {}
304+
_CCCL_FORCEINLINE ReduceBySegmentOp() = default;
305305

306306
/// Constructor
307307
_CCCL_HOST_DEVICE _CCCL_FORCEINLINE ReduceBySegmentOp(ReductionOpT op)
@@ -362,7 +362,7 @@ struct ReduceByKeyOp
362362
ReductionOpT op;
363363

364364
/// Constructor
365-
_CCCL_HOST_DEVICE _CCCL_FORCEINLINE ReduceByKeyOp() {}
365+
_CCCL_FORCEINLINE ReduceByKeyOp() = default;
366366

367367
/// Constructor
368368
_CCCL_HOST_DEVICE _CCCL_FORCEINLINE ReduceByKeyOp(ReductionOpT op)

cub/cub/util_type.cuh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,11 +704,11 @@ struct KeyValuePair
704704
using Key = _Key; ///< Key data type
705705
using Value = _Value; ///< Value data type
706706

707-
Key key; ///< Item key
708-
Value value; ///< Item value
707+
Key key{}; ///< Item key
708+
Value value{}; ///< Item value
709709

710710
/// Constructor
711-
_CCCL_HOST_DEVICE _CCCL_FORCEINLINE KeyValuePair() {}
711+
_CCCL_FORCEINLINE KeyValuePair() = default;
712712

713713
/// Constructor
714714
_CCCL_HOST_DEVICE _CCCL_FORCEINLINE KeyValuePair(Key const& key, Value const& value)

cub/test/catch2_test_device_scan_iterators.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ class custom_accumulator_t
179179
{}
180180

181181
public:
182-
__host__ __device__ custom_accumulator_t() {}
182+
custom_accumulator_t() = default;
183183

184184
__host__ __device__ custom_accumulator_t(const custom_accumulator_t& in)
185185
: m_val(in.is_valid() * in.get())

cub/test/catch2_test_device_transform.cu

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,12 @@ struct non_trivial
521521
: data(data)
522522
{}
523523

524+
// NOLINTNEXTLINE(modernize-use-equals-default)
524525
__host__ __device__ non_trivial(const non_trivial& nt)
525526
: data(nt.data)
526527
{}
527528

529+
// NOLINTNEXTLINE(modernize-use-equals-default)
528530
__host__ __device__ auto operator=(const non_trivial& nt) -> non_trivial&
529531
{
530532
data = nt.data;

cudax/test/execution/common/utility.cuh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,16 @@ struct potentially_throwing
6767

6868
_CCCL_HOST_DEVICE potentially_throwing(potentially_throwing&&) noexcept(false) {}
6969

70-
_CCCL_HOST_DEVICE potentially_throwing(const potentially_throwing&) noexcept(false) {}
70+
_CCCL_HOST_DEVICE
71+
potentially_throwing(const potentially_throwing&) noexcept(false) // NOLINT(modernize-use-equals-default)
72+
{}
7173

7274
_CCCL_HOST_DEVICE potentially_throwing& operator=(potentially_throwing&&) noexcept(false)
7375
{
7476
return *this;
7577
}
7678

79+
// NOLINTNEXTLINE(modernize-use-equals-default)
7780
_CCCL_HOST_DEVICE potentially_throwing& operator=(const potentially_throwing&) noexcept(false)
7881
{
7982
return *this;

0 commit comments

Comments
 (0)