Skip to content

Commit

Permalink
[clang-tidy] No. 59,60 bugprone-unused-return-value, bugprone-suspici…
Browse files Browse the repository at this point in the history
…ous-missing-comma
  • Loading branch information
xiaoyewww committed Aug 29, 2023
1 parent 220f13b commit 8fb60f4
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ bugprone-misplaced-widening-cast,
-bugprone-string-literal-with-embedded-nul,
-bugprone-suspicious-enum-usage,
-bugprone-suspicious-memset-usage,
-bugprone-suspicious-missing-comma,
bugprone-suspicious-missing-comma,
-bugprone-suspicious-semicolon,
-bugprone-suspicious-string-compare,
-bugprone-terminating-continue,
Expand All @@ -42,7 +42,7 @@ bugprone-misplaced-widening-cast,
-bugprone-undelegated-constructor,
bugprone-unhandled-self-assignment,
bugprone-unused-raii,
-bugprone-unused-return-value,
bugprone-unused-return-value,
bugprone-use-after-move,
-bugprone-virtual-near-miss,
-clang-analyzer-apiModeling.StdCLibraryFunctions,
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/distributed/fleet_executor/fleet_executor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void FleetExecutor::Init(
framework::GetUnusedVars(program_desc.Block(0), ops, {});

for (auto& unique_op : ops) {
unique_op.release();
[[maybe_unused]] auto released_op = unique_op.release();
}

// NOTE: For inference, the vars in inference_root_scope_vars
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ void ComputePropagateScalesMkldnnPass::ApplyImpl(ir::Graph* graph) const {
FusePassBase::Init(pattern_name, graph);

const std::unordered_set<std::string> scale_immutable_ops = {
"fused_transpose"
"fused_transpose",
"transpose2",
"reshape2",
"pool2d",
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/framework/operator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2022,7 +2022,7 @@ void OperatorWithKernel::RunImpl(const Scope& scope,
ExecutionContext(*this, exec_scope, *dev_ctx, *runtime_ctx));
}
if (fallback_to_cpu) {
phi_kernel_.release();
[[maybe_unused]] auto released_kernel = phi_kernel_.release();
}
}

Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/pybind/eager_legacy_op_function_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,11 @@ int main(int argc, char* argv[]) { // NOLINT
paddle::operators::RegisterCustomDeviceCommonKernel("fake_device");
#endif

const std::string str = "\"paddle/fluid/eager/api/generated/fluid_generated/";
std::vector<std::string> headers{
"<Python.h>",
"\"paddle/fluid/platform/enforce.h\"",
"\"paddle/fluid/eager/api/generated/fluid_generated/"
"dygraph_forward_api.h\"",
str + "dygraph_forward_api.h\"",
"\"paddle/fluid/pybind/eager_utils.h\"",
"\"paddle/fluid/platform/profiler/event_tracing.h\"",
"\"paddle/fluid/pybind/exception.h\"",
Expand Down

0 comments on commit 8fb60f4

Please sign in to comment.