Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang-tidy] NO.29 enable bugprone-exception-escape #61609

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion paddle/fluid/framework/details/eager_deletion_op_handle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ EagerDeletionOpHandle::EagerDeletionOpHandle(
}
}

EagerDeletionOpHandle::~EagerDeletionOpHandle() {
EagerDeletionOpHandle::~EagerDeletionOpHandle() { // NOLINT
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
if (event_) {
auto gpu_place = dev_ctx_->GetPlace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ FusedAllReduceOpHandle::FusedAllReduceOpHandle(
num_of_all_reduce_(num_of_all_reduce) {}
#endif

FusedAllReduceOpHandle::~FusedAllReduceOpHandle() {
FusedAllReduceOpHandle::~FusedAllReduceOpHandle() { // NOLINT
#if defined(PADDLE_WITH_NCCL) || defined(PADDLE_WITH_RCCL)
auto destroy_event = [](gpuEvent_t event) {
if (event == nullptr) return;
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/inference/api/resource_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ GPUContextResource::GPUContextResource(const phi::Place& place, void* stream)
InitGPUResource(stream);
}

GPUContextResource::~GPUContextResource() { DestroyGPUResource(); }
GPUContextResource::~GPUContextResource() { DestroyGPUResource(); } // NOLINT

void GPUContextResource::InitGPUResource(void* stream) {
phi::backends::gpu::GPUDeviceGuard guard(place_.device);
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/backends/onednn/onednn_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ OneDNNContextThreadLocals::Body::Body()
// and other is to start inference
// TODO(jczaja): Ideally it would be good to clear only part of cache
// related to thread that is to be terminated
OneDNNContextThreadLocals::Body::~Body() {
OneDNNContextThreadLocals::Body::~Body() { // NOLINT
auto cpu_place = phi::CPUPlace();
// TODO(YuanRisheng): we need remove the dependency on fluid device context
// here
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/core/sparse_coo_tensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SparseCooTensor::SparseCooTensor() {
this->SetMember(non_zero_indices, non_zero_elements, {1}, true);
}

SparseCooTensor::SparseCooTensor(SparseCooTensor&& other) noexcept {
SparseCooTensor::SparseCooTensor(SparseCooTensor&& other) noexcept { // NOLINT
this->non_zero_elements_ = other.non_zero_elements_;
this->non_zero_indices_ = other.non_zero_indices_;
this->coalesced_ = other.coalesced_;
Expand Down
3 changes: 2 additions & 1 deletion paddle/phi/core/string_tensor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ StringTensor& StringTensor::operator=(const StringTensor& other) {
return *this;
}

StringTensor& StringTensor::operator=(StringTensor&& other) noexcept {
StringTensor& StringTensor::operator=(
StringTensor&& other) noexcept { // NOLINT
meta_ = std::move(other.meta_);
std::swap(holder_, other.holder_);
return *this;
Expand Down