Skip to content

Commit c0f5dac

Browse files
authored
[clang-tidy] NO.65 enable clang-analyzer-cplusplus.InnerPointer check (#56693)
* enable clang-analyzer-cplusplus.InnerPointer check * fix bug
1 parent d7e0f87 commit c0f5dac

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

.clang-tidy

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ bugprone-unused-raii,
6767
-clang-analyzer-core.uninitialized.Branch,
6868
-clang-analyzer-core.uninitialized.CapturedBlockVariable,
6969
-clang-analyzer-core.uninitialized.UndefReturn,
70-
-clang-analyzer-cplusplus.InnerPointer,
70+
clang-analyzer-cplusplus.InnerPointer,
7171
-clang-analyzer-cplusplus.Move,
7272
-clang-analyzer-cplusplus.NewDelete,
7373
-clang-analyzer-cplusplus.NewDeleteLeaks,

paddle/phi/kernels/funcs/math_function.cc

+2-4
Original file line numberDiff line numberDiff line change
@@ -277,16 +277,14 @@ struct RowwiseAdd<phi::CPUContext, T> {
277277
" Expected vector size=%d, but received %d",
278278
size,
279279
vector.numel()));
280-
const char* in_dims_cstr = in_dims.to_str().c_str();
281-
const char* out_dims_cstr = out_dims.to_str().c_str();
282280
PADDLE_ENFORCE_EQ(out_dims,
283281
in_dims,
284282
phi::errors::InvalidArgument(
285283
"The output tensor shape should be same as the input"
286284
" tensor shape. Expected output tensor shape: %s,"
287285
" but received %s",
288-
in_dims_cstr,
289-
out_dims_cstr));
286+
in_dims.to_str().c_str(),
287+
out_dims.to_str().c_str()));
290288

291289
auto in = phi::EigenMatrix<T>::From(input);
292290
auto vec = phi::EigenVector<T>::Flatten(vector);

0 commit comments

Comments
 (0)