未验证 提交 31305820 编写于 作者: X xiaoye 提交者: GitHub

[clang-tidy] No. 59,60 bugprone-unused-return-value, bugprone-suspicious-missing-comma (#56676)

上级 abf7af22
...@@ -32,7 +32,7 @@ bugprone-misplaced-widening-cast, ...@@ -32,7 +32,7 @@ bugprone-misplaced-widening-cast,
-bugprone-string-literal-with-embedded-nul, -bugprone-string-literal-with-embedded-nul,
-bugprone-suspicious-enum-usage, -bugprone-suspicious-enum-usage,
-bugprone-suspicious-memset-usage, -bugprone-suspicious-memset-usage,
-bugprone-suspicious-missing-comma, bugprone-suspicious-missing-comma,
-bugprone-suspicious-semicolon, -bugprone-suspicious-semicolon,
-bugprone-suspicious-string-compare, -bugprone-suspicious-string-compare,
-bugprone-terminating-continue, -bugprone-terminating-continue,
...@@ -42,7 +42,7 @@ bugprone-misplaced-widening-cast, ...@@ -42,7 +42,7 @@ bugprone-misplaced-widening-cast,
-bugprone-undelegated-constructor, -bugprone-undelegated-constructor,
bugprone-unhandled-self-assignment, bugprone-unhandled-self-assignment,
bugprone-unused-raii, bugprone-unused-raii,
-bugprone-unused-return-value, bugprone-unused-return-value,
bugprone-use-after-move, bugprone-use-after-move,
-bugprone-virtual-near-miss, -bugprone-virtual-near-miss,
-clang-analyzer-apiModeling.StdCLibraryFunctions, -clang-analyzer-apiModeling.StdCLibraryFunctions,
......
...@@ -190,7 +190,7 @@ void FleetExecutor::Init( ...@@ -190,7 +190,7 @@ void FleetExecutor::Init(
framework::GetUnusedVars(program_desc.Block(0), ops, {}); framework::GetUnusedVars(program_desc.Block(0), ops, {});
for (auto& unique_op : 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 // NOTE: For inference, the vars in inference_root_scope_vars
......
...@@ -492,7 +492,7 @@ void ComputePropagateScalesMkldnnPass::ApplyImpl(ir::Graph* graph) const { ...@@ -492,7 +492,7 @@ void ComputePropagateScalesMkldnnPass::ApplyImpl(ir::Graph* graph) const {
FusePassBase::Init(pattern_name, graph); FusePassBase::Init(pattern_name, graph);
const std::unordered_set<std::string> scale_immutable_ops = { const std::unordered_set<std::string> scale_immutable_ops = {
"fused_transpose" "fused_transpose",
"transpose2", "transpose2",
"reshape2", "reshape2",
"pool2d", "pool2d",
......
...@@ -2022,7 +2022,7 @@ void OperatorWithKernel::RunImpl(const Scope& scope, ...@@ -2022,7 +2022,7 @@ void OperatorWithKernel::RunImpl(const Scope& scope,
ExecutionContext(*this, exec_scope, *dev_ctx, *runtime_ctx)); ExecutionContext(*this, exec_scope, *dev_ctx, *runtime_ctx));
} }
if (fallback_to_cpu) { if (fallback_to_cpu) {
phi_kernel_.release(); [[maybe_unused]] auto released_kernel = phi_kernel_.release();
} }
} }
......
...@@ -488,11 +488,11 @@ int main(int argc, char* argv[]) { // NOLINT ...@@ -488,11 +488,11 @@ int main(int argc, char* argv[]) { // NOLINT
paddle::operators::RegisterCustomDeviceCommonKernel("fake_device"); paddle::operators::RegisterCustomDeviceCommonKernel("fake_device");
#endif #endif
const std::string str = "\"paddle/fluid/eager/api/generated/fluid_generated/";
std::vector<std::string> headers{ std::vector<std::string> headers{
"<Python.h>", "<Python.h>",
"\"paddle/fluid/platform/enforce.h\"", "\"paddle/fluid/platform/enforce.h\"",
"\"paddle/fluid/eager/api/generated/fluid_generated/" str + "dygraph_forward_api.h\"",
"dygraph_forward_api.h\"",
"\"paddle/fluid/pybind/eager_utils.h\"", "\"paddle/fluid/pybind/eager_utils.h\"",
"\"paddle/fluid/platform/profiler/event_tracing.h\"", "\"paddle/fluid/platform/profiler/event_tracing.h\"",
"\"paddle/fluid/pybind/exception.h\"", "\"paddle/fluid/pybind/exception.h\"",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册