Skip to content

Commit

Permalink
[clang-tidy] NO.65 enable clang-analyzer-cplusplus.InnerPointer che…
Browse files Browse the repository at this point in the history
…ck (#56693)

* enable clang-analyzer-cplusplus.InnerPointer check

* fix bug
  • Loading branch information
ccsuzzh authored Aug 28, 2023
1 parent d7e0f87 commit c0f5dac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ bugprone-unused-raii,
-clang-analyzer-core.uninitialized.Branch,
-clang-analyzer-core.uninitialized.CapturedBlockVariable,
-clang-analyzer-core.uninitialized.UndefReturn,
-clang-analyzer-cplusplus.InnerPointer,
clang-analyzer-cplusplus.InnerPointer,
-clang-analyzer-cplusplus.Move,
-clang-analyzer-cplusplus.NewDelete,
-clang-analyzer-cplusplus.NewDeleteLeaks,
Expand Down
6 changes: 2 additions & 4 deletions paddle/phi/kernels/funcs/math_function.cc
Original file line number Diff line number Diff line change
Expand Up @@ -277,16 +277,14 @@ struct RowwiseAdd<phi::CPUContext, T> {
" Expected vector size=%d, but received %d",
size,
vector.numel()));
const char* in_dims_cstr = in_dims.to_str().c_str();
const char* out_dims_cstr = out_dims.to_str().c_str();
PADDLE_ENFORCE_EQ(out_dims,
in_dims,
phi::errors::InvalidArgument(
"The output tensor shape should be same as the input"
" tensor shape. Expected output tensor shape: %s,"
" but received %s",
in_dims_cstr,
out_dims_cstr));
in_dims.to_str().c_str(),
out_dims.to_str().c_str()));

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

0 comments on commit c0f5dac

Please # to comment.