From 28f54e71f33b2f560d291f2f875505d24e362a0b Mon Sep 17 00:00:00 2001 From: Adam Simpkins Date: Tue, 16 Nov 2021 10:19:40 -0800 Subject: [PATCH] fix compile errors in db/kv_checksum.h (#9173) Summary: When defining a template class, the constructor should be specified simply using the class name; it does not take template arguments.a Apparently older versions of gcc and clang did not complain about this syntax, but gcc 11.x and recent versions of clang both complain about this file. Pull Request resolved: https://github.com/facebook/rocksdb/pull/9173 Test Plan: When building with platform010 I got compile errors in this file both in `mode/dev` (clang) and in `mode/opt-gcc`. This diff fixes the compile failures. Reviewed By: ajkr Differential Revision: D32455881 Pulled By: simpkins fbshipit-source-id: 0682910d9e2cdade94ce1e77973d47ac04d9f7e2 --- db/kv_checksum.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/db/kv_checksum.h b/db/kv_checksum.h index bfec80b51..0729d1318 100644 --- a/db/kv_checksum.h +++ b/db/kv_checksum.h @@ -56,7 +56,7 @@ using ProtectionInfoKVOS64 = ProtectionInfoKVOS; template class ProtectionInfo { public: - ProtectionInfo() = default; + ProtectionInfo() = default; Status GetStatus() const; ProtectionInfoKVO ProtectKVO(const Slice& key, const Slice& value, @@ -83,7 +83,7 @@ class ProtectionInfo { static const uint64_t kSeedS = 0x77A00858DDD37F21; static const uint64_t kSeedC = 0x4A2AB5CBD26F542C; - ProtectionInfo(T val) : val_(val) { + ProtectionInfo(T val) : val_(val) { static_assert(sizeof(ProtectionInfo) == sizeof(T), ""); } @@ -96,7 +96,7 @@ class ProtectionInfo { template class ProtectionInfoKVO { public: - ProtectionInfoKVO() = default; + ProtectionInfoKVO() = default; ProtectionInfo StripKVO(const Slice& key, const Slice& value, ValueType op_type) const; @@ -117,7 +117,7 @@ class ProtectionInfoKVO { friend class ProtectionInfoKVOS; friend class ProtectionInfoKVOC; - explicit ProtectionInfoKVO(T val) : info_(val) { + explicit ProtectionInfoKVO(T val) : info_(val) { static_assert(sizeof(ProtectionInfoKVO) == sizeof(T), ""); } @@ -130,7 +130,7 @@ class ProtectionInfoKVO { template class ProtectionInfoKVOC { public: - ProtectionInfoKVOC() = default; + ProtectionInfoKVOC() = default; ProtectionInfoKVO StripC(ColumnFamilyId column_family_id) const; @@ -155,7 +155,7 @@ class ProtectionInfoKVOC { private: friend class ProtectionInfoKVO; - explicit ProtectionInfoKVOC(T val) : kvo_(val) { + explicit ProtectionInfoKVOC(T val) : kvo_(val) { static_assert(sizeof(ProtectionInfoKVOC) == sizeof(T), ""); } @@ -168,7 +168,7 @@ class ProtectionInfoKVOC { template class ProtectionInfoKVOS { public: - ProtectionInfoKVOS() = default; + ProtectionInfoKVOS() = default; ProtectionInfoKVO StripS(SequenceNumber sequence_number) const; @@ -193,7 +193,7 @@ class ProtectionInfoKVOS { private: friend class ProtectionInfoKVO; - explicit ProtectionInfoKVOS(T val) : kvo_(val) { + explicit ProtectionInfoKVOS(T val) : kvo_(val) { static_assert(sizeof(ProtectionInfoKVOS) == sizeof(T), ""); }