From 6d19073ad5c20cce98acb6296f1155bade5e6c31 Mon Sep 17 00:00:00 2001 From: gouzil <66515297+gouzil@users.noreply.github.com> Date: Wed, 30 Aug 2023 11:06:50 +0800 Subject: [PATCH] [clang-tidy] enable clang-analyzer-optin.cplusplus.UninitializedObject check (#56648) --- .clang-tidy | 2 +- paddle/phi/common/place.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 820a244182d..18576ae15bb 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -83,7 +83,7 @@ clang-analyzer-cplusplus.InnerPointer, -clang-analyzer-nullability.NullableDereferenced, -clang-analyzer-nullability.NullablePassedToNonnull, -clang-analyzer-nullability.NullableReturnedFromNonnull, --clang-analyzer-optin.cplusplus.UninitializedObject, +clang-analyzer-optin.cplusplus.UninitializedObject, -clang-analyzer-optin.cplusplus.VirtualCall, -clang-analyzer-optin.mpi.MPI-Checker, -clang-analyzer-optin.osx.OSObjectCStyleCast, diff --git a/paddle/phi/common/place.h b/paddle/phi/common/place.h index 09f7c53cde8..82731d9984d 100644 --- a/paddle/phi/common/place.h +++ b/paddle/phi/common/place.h @@ -54,7 +54,8 @@ const char* AllocationTypeStr(AllocationType type); /// \brief The place is used to specify where the data is stored. class PADDLE_API Place { public: - Place() : device(0), alloc_type_(AllocationType::UNDEFINED) {} + Place() + : device(0), alloc_type_(AllocationType::UNDEFINED), device_type_id_(0) {} explicit Place(AllocationType type, int8_t id, -- GitLab