Skip to content

Commit

Permalink
[clang-tidy] NO.28 enable modernize-use-equals-default (#61614)
Browse files Browse the repository at this point in the history
* clangtidy 28

* fix
  • Loading branch information
enkilee authored Feb 21, 2024
1 parent 5d314d2 commit 1043061
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static const std::initializer_list<std::string> rnn_variable_names{

class ComputePropagateScalesMkldnnPassTest : public testing::Test {
public:
ComputePropagateScalesMkldnnPassTest() {
ComputePropagateScalesMkldnnPassTest() { // NOLINT
pass = std::make_unique<ComputePropagateScalesMkldnnPass>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ InterpreterCoreEventGarbageCollector::InterpreterCoreEventGarbageCollector(
}
}

InterpreterCoreEventGarbageCollector::~InterpreterCoreEventGarbageCollector() {
InterpreterCoreEventGarbageCollector::
~InterpreterCoreEventGarbageCollector() { // NOLINT
queue_.reset(nullptr);
}

Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/framework/op_desc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ OpDesc::OpDesc(const std::string &type,
InitRuntimeAttributeMapByOpExtraInfo(type, &runtime_attrs_);
}

OpDesc::OpDesc() {}
OpDesc::OpDesc() = default;

OpDesc::~OpDesc() = default;
OpDesc::OpDesc(const OpDesc &other) {
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/framework/scope.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ COMMON_DECLARE_bool(eager_delete_scope);

namespace paddle {
namespace framework {
Scope::Scope() {}
Scope::Scope() = default;
Scope::~Scope() { DropKids(); } // NOLINT

Scope& Scope::NewScope() const {
Expand Down
4 changes: 2 additions & 2 deletions paddle/phi/infermeta/spmd_rules/dim_trans.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace distributed {

DimTrans::DimTrans(Type type) : type_(type) {}

DimTrans::~DimTrans() {}
DimTrans::~DimTrans() = default;

DimTrans::Type DimTrans::type() const { return type_; }

Expand All @@ -39,7 +39,7 @@ InputDim::InputDim(int64_t dim) : DimTrans(DimTrans::Type::INPUTDIM) {
input_dim_ = dim;
}

InputDim::~InputDim() {}
InputDim::~InputDim() = default;

int64_t InputDim::input_dim() const { return input_dim_; }

Expand Down
2 changes: 1 addition & 1 deletion paddle/pir/src/core/op_operand.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
CHECK_NULL_IMPL(OpOpernad, func_name)

namespace pir {
OpOperand &OpOperand::operator=(const OpOperand &rhs) {
OpOperand &OpOperand::operator=(const OpOperand &rhs) { // NOLINT
impl_ = rhs.impl_;
return *this;
}
Expand Down

0 comments on commit 1043061

Please sign in to comment.