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
main
Adam Simpkins 3 years ago committed by Facebook GitHub Bot
parent 230f18b6e1
commit 28f54e71f3
  1. 16
      db/kv_checksum.h

@ -56,7 +56,7 @@ using ProtectionInfoKVOS64 = ProtectionInfoKVOS<uint64_t>;
template <typename T> template <typename T>
class ProtectionInfo { class ProtectionInfo {
public: public:
ProtectionInfo<T>() = default; ProtectionInfo() = default;
Status GetStatus() const; Status GetStatus() const;
ProtectionInfoKVO<T> ProtectKVO(const Slice& key, const Slice& value, ProtectionInfoKVO<T> ProtectKVO(const Slice& key, const Slice& value,
@ -83,7 +83,7 @@ class ProtectionInfo {
static const uint64_t kSeedS = 0x77A00858DDD37F21; static const uint64_t kSeedS = 0x77A00858DDD37F21;
static const uint64_t kSeedC = 0x4A2AB5CBD26F542C; static const uint64_t kSeedC = 0x4A2AB5CBD26F542C;
ProtectionInfo<T>(T val) : val_(val) { ProtectionInfo(T val) : val_(val) {
static_assert(sizeof(ProtectionInfo<T>) == sizeof(T), ""); static_assert(sizeof(ProtectionInfo<T>) == sizeof(T), "");
} }
@ -96,7 +96,7 @@ class ProtectionInfo {
template <typename T> template <typename T>
class ProtectionInfoKVO { class ProtectionInfoKVO {
public: public:
ProtectionInfoKVO<T>() = default; ProtectionInfoKVO() = default;
ProtectionInfo<T> StripKVO(const Slice& key, const Slice& value, ProtectionInfo<T> StripKVO(const Slice& key, const Slice& value,
ValueType op_type) const; ValueType op_type) const;
@ -117,7 +117,7 @@ class ProtectionInfoKVO {
friend class ProtectionInfoKVOS<T>; friend class ProtectionInfoKVOS<T>;
friend class ProtectionInfoKVOC<T>; friend class ProtectionInfoKVOC<T>;
explicit ProtectionInfoKVO<T>(T val) : info_(val) { explicit ProtectionInfoKVO(T val) : info_(val) {
static_assert(sizeof(ProtectionInfoKVO<T>) == sizeof(T), ""); static_assert(sizeof(ProtectionInfoKVO<T>) == sizeof(T), "");
} }
@ -130,7 +130,7 @@ class ProtectionInfoKVO {
template <typename T> template <typename T>
class ProtectionInfoKVOC { class ProtectionInfoKVOC {
public: public:
ProtectionInfoKVOC<T>() = default; ProtectionInfoKVOC() = default;
ProtectionInfoKVO<T> StripC(ColumnFamilyId column_family_id) const; ProtectionInfoKVO<T> StripC(ColumnFamilyId column_family_id) const;
@ -155,7 +155,7 @@ class ProtectionInfoKVOC {
private: private:
friend class ProtectionInfoKVO<T>; friend class ProtectionInfoKVO<T>;
explicit ProtectionInfoKVOC<T>(T val) : kvo_(val) { explicit ProtectionInfoKVOC(T val) : kvo_(val) {
static_assert(sizeof(ProtectionInfoKVOC<T>) == sizeof(T), ""); static_assert(sizeof(ProtectionInfoKVOC<T>) == sizeof(T), "");
} }
@ -168,7 +168,7 @@ class ProtectionInfoKVOC {
template <typename T> template <typename T>
class ProtectionInfoKVOS { class ProtectionInfoKVOS {
public: public:
ProtectionInfoKVOS<T>() = default; ProtectionInfoKVOS() = default;
ProtectionInfoKVO<T> StripS(SequenceNumber sequence_number) const; ProtectionInfoKVO<T> StripS(SequenceNumber sequence_number) const;
@ -193,7 +193,7 @@ class ProtectionInfoKVOS {
private: private:
friend class ProtectionInfoKVO<T>; friend class ProtectionInfoKVO<T>;
explicit ProtectionInfoKVOS<T>(T val) : kvo_(val) { explicit ProtectionInfoKVOS(T val) : kvo_(val) {
static_assert(sizeof(ProtectionInfoKVOS<T>) == sizeof(T), ""); static_assert(sizeof(ProtectionInfoKVOS<T>) == sizeof(T), "");
} }

Loading…
Cancel
Save