diff --git a/tcmalloc/testing/aligned_new_test.cc b/tcmalloc/testing/aligned_new_test.cc index 303c8e616..cf16a7a4d 100644 --- a/tcmalloc/testing/aligned_new_test.cc +++ b/tcmalloc/testing/aligned_new_test.cc @@ -162,12 +162,12 @@ TYPED_TEST_P(AlignedNew, ArraySizeCheckSampling) { // track of the true size of arrays so that the proper number of destructors // can be invoked. struct NonTrivial { - virtual ~NonTrivial() {} + virtual ~NonTrivial() = default; TypeParam p; }; - static_assert(!std::is_trivially_destructible::value, + static_assert(!std::is_trivially_destructible_v, "NonTrivial should have a nontrivial destructor."); // The HeapLeakChecker initializes malloc hooks which we call prior to looking diff --git a/tcmalloc/testing/tcmalloc_large_test.cc b/tcmalloc/testing/tcmalloc_large_test.cc index ef901b2d2..2dda0def9 100644 --- a/tcmalloc/testing/tcmalloc_large_test.cc +++ b/tcmalloc/testing/tcmalloc_large_test.cc @@ -94,7 +94,7 @@ class NoErrnoRegionFactory final : public AddressRegionFactory { public: explicit NoErrnoRegionFactory(AddressRegionFactory* underlying) : underlying_(underlying) {} - ~NoErrnoRegionFactory() override {} + ~NoErrnoRegionFactory() override = default; AddressRegion* Create(void* start, size_t size, UsageHint hint) override { AddressRegion* underlying_region = underlying_->Create(start, size, hint); diff --git a/tcmalloc/testing/tcmalloc_test.cc b/tcmalloc/testing/tcmalloc_test.cc index dd83ebc08..ef8b9252d 100644 --- a/tcmalloc/testing/tcmalloc_test.cc +++ b/tcmalloc/testing/tcmalloc_test.cc @@ -512,7 +512,7 @@ TEST(TCMallocTest, NothrowSizedDelete) { TEST(TCMallocTest, NothrowSizedDeleteArray) { struct Foo { - ~Foo() {} + ~Foo() = default; double a; }; // Foo should correspond to a size class used by new, but not by malloc, @@ -521,7 +521,7 @@ TEST(TCMallocTest, NothrowSizedDeleteArray) { static_assert(sizeof(Foo) == 8, "Unexpected size for Foo"); // With a non-trivially destructible type, we expect the compiler to insert a // size cookie so it can invoke sized delete[]. - static_assert(!std::is_trivially_destructible::value, + static_assert(!std::is_trivially_destructible_v, "Foo should not be trivially destructable, for sized delete[]"); static constexpr int kNum = 100;