From d3339a7cd5f10e8a6b2a6c64daa66cd71a3e81d3 Mon Sep 17 00:00:00 2001 From: Vasil Dimov Date: Mon, 20 Jan 2025 14:32:20 +0100 Subject: [PATCH] util: fix compiler warning about deprecated space before _MiB ``` src/util/byte_units.h:13:29: error: identifier '_MiB' preceded by whitespace in a literal operator declaration is deprecated [-Werror,-Wdeprecated-literal-operator] 13 | constexpr size_t operator"" _MiB(unsigned long long mebibytes) | ~~~~~~~~~~~^~~~ | operator""_MiB 1 error generated. ``` Clang 20.0.0 --- src/util/byte_units.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/byte_units.h b/src/util/byte_units.h index 894f057a7e4..3d6a9627d88 100644 --- a/src/util/byte_units.h +++ b/src/util/byte_units.h @@ -10,7 +10,7 @@ #include //! Overflow-safe conversion of MiB to bytes. -constexpr size_t operator"" _MiB(unsigned long long mebibytes) +constexpr size_t operator""_MiB(unsigned long long mebibytes) { auto bytes{CheckedLeftShift(mebibytes, 20)}; if (!bytes || *bytes > std::numeric_limits::max()) {