From 31a9688868e05d6df1b8b9d56df3dc1253e49a55 Mon Sep 17 00:00:00 2001 From: Nyakku Shigure Date: Wed, 30 Aug 2023 11:45:23 +0800 Subject: [PATCH] [clang-tidy][task 61] enable `hicpp-exception-baseclass` and fix existing errors (#55847) * [clang-tidy] enable `hicpp-exception-baseclass` and fix existing errors * config * update error format to pass the ci check (at least 20 chars) --- .clang-tidy | 2 +- .../ir/mkldnn/reshape_transpose_matmul_mkldnn_fuse_pass.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 18576ae15bb..37d956eaa94 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -162,7 +162,7 @@ cppcoreguidelines-c-copy-assignment-signature, -cppcoreguidelines-pro-type-member-init, -cppcoreguidelines-slicing, -hicpp-avoid-goto, --hicpp-exception-baseclass, +hicpp-exception-baseclass, misc-unused-alias-decls, misc-unused-using-decls, modernize-avoid-bind, diff --git a/paddle/fluid/framework/ir/mkldnn/reshape_transpose_matmul_mkldnn_fuse_pass.cc b/paddle/fluid/framework/ir/mkldnn/reshape_transpose_matmul_mkldnn_fuse_pass.cc index e5a8c5330e1..07675a3f4ef 100644 --- a/paddle/fluid/framework/ir/mkldnn/reshape_transpose_matmul_mkldnn_fuse_pass.cc +++ b/paddle/fluid/framework/ir/mkldnn/reshape_transpose_matmul_mkldnn_fuse_pass.cc @@ -99,8 +99,8 @@ void ReshapeTransposeMatmulMkldnnFusePass::Fuse( } else if (matmul_desc->Inputs().at("Y").at(0) == input_var_name) { matmul_input_name = "Y"; } else { - throw platform::errors::InvalidArgument("Unexpected input to " + - matmul_type + " encountered."); + PADDLE_THROW(platform::errors::InvalidArgument( + "Unexpected input to %s encountered.", matmul_type)); } // Return if input of fused_matmul is already fused -- GitLab