From 810ab34ede79f9fea6ad1bd751366846c875adf8 Mon Sep 17 00:00:00 2001 From: Levi Tamasi Date: Thu, 8 Oct 2020 10:47:47 -0700 Subject: [PATCH] Do not rely on the two-argument std::pair constructor being constexpr (#7519) Summary: The `std::pair(const T1& x, const T2& y);` constructor is `constexpr` only starting from C++14; relying on this breaks compilation on certain compilers/platforms we need to support. Pull Request resolved: https://github.com/facebook/rocksdb/pull/7519 Test Plan: `make check` Reviewed By: ajkr Differential Revision: D24195747 Pulled By: ltamasi fbshipit-source-id: 665e8fbc9747675bb49c5d895aad3dcf2714750f --- db/blob/blob_file_reader_test.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/db/blob/blob_file_reader_test.cc b/db/blob/blob_file_reader_test.cc index 0830b3b8fa..e8af662f1e 100644 --- a/db/blob/blob_file_reader_test.cc +++ b/db/blob/blob_file_reader_test.cc @@ -329,7 +329,8 @@ TEST_F(BlobFileReaderTest, ExpirationRangeInHeader) { constexpr uint32_t column_family_id = 1; constexpr bool has_ttl = false; - constexpr ExpirationRange expiration_range_header(1, 2); + const ExpirationRange expiration_range_header( + 1, 2); // can be made constexpr when we adopt C++14 constexpr ExpirationRange expiration_range_footer; constexpr uint64_t blob_file_number = 1; constexpr char key[] = "key"; @@ -367,7 +368,8 @@ TEST_F(BlobFileReaderTest, ExpirationRangeInFooter) { constexpr uint32_t column_family_id = 1; constexpr bool has_ttl = false; constexpr ExpirationRange expiration_range_header; - constexpr ExpirationRange expiration_range_footer(1, 2); + const ExpirationRange expiration_range_footer( + 1, 2); // can be made constexpr when we adopt C++14 constexpr uint64_t blob_file_number = 1; constexpr char key[] = "key"; constexpr char blob[] = "blob";