From 11097095564d2b31e569f9f380734d1c2c8fe35f Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Wed, 20 Jul 2022 14:23:44 -0700 Subject: [PATCH] Fix build errors with c++latest. --- include/vcpkg/base/format.h | 2 +- include/vcpkg/base/messages.h | 4 ++-- src/vcpkg-test/ci-baseline.cpp | 6 +++--- src/vcpkg-test/json.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/vcpkg/base/format.h b/include/vcpkg/base/format.h index 5ebc178c1b..7017f2261c 100644 --- a/include/vcpkg/base/format.h +++ b/include/vcpkg/base/format.h @@ -32,7 +32,7 @@ namespace fmt template auto format(const vcpkg::LineInfo& li, FormatContext& ctx) const -> decltype(ctx.out()) { - return format_to(ctx.out(), "{}({})", li.file_name, li.line_number); + return fmt::format_to(ctx.out(), "{}({})", li.file_name, li.line_number); } }; diff --git a/include/vcpkg/base/messages.h b/include/vcpkg/base/messages.h index b295f07b35..53a0849010 100644 --- a/include/vcpkg/base/messages.h +++ b/include/vcpkg/base/messages.h @@ -52,9 +52,9 @@ namespace vcpkg return *this; } template - LocalizedString& append_fmt_raw(fmt::string_view s, const Args&... args) + LocalizedString& append_fmt_raw(fmt::format_string s, Args&&... args) { - m_data.append(fmt::format(s, args...)); + m_data.append(fmt::format(s, std::forward(args)...)); return *this; } LocalizedString& append(const LocalizedString& s) diff --git a/src/vcpkg-test/ci-baseline.cpp b/src/vcpkg-test/ci-baseline.cpp index a601fc88aa..1244fa00fb 100644 --- a/src/vcpkg-test/ci-baseline.cpp +++ b/src/vcpkg-test/ci-baseline.cpp @@ -329,9 +329,9 @@ TEST_CASE ("format_ci_result 1", "[ci-baseline]") cidata.required_success = { PackageSpec{"pass", Test::X64_UWP}, }; - const char* failmsg = "REGRESSION: {0} failed with BUILD_FAILED. If expected, add {0}=fail to cifile."; - const char* cascademsg = "REGRESSION: {0} cascaded, but it is required to pass. (cifile)."; - const char* passmsg = "PASSING, REMOVE FROM FAIL LIST: {0} (cifile)."; + constexpr const char failmsg[] = "REGRESSION: {0} failed with BUILD_FAILED. If expected, add {0}=fail to cifile."; + constexpr const char cascademsg[] = "REGRESSION: {0} cascaded, but it is required to pass. (cifile)."; + constexpr const char passmsg[] = "PASSING, REMOVE FROM FAIL LIST: {0} (cifile)."; SECTION ("SUCCEEDED") { diff --git a/src/vcpkg-test/json.cpp b/src/vcpkg-test/json.cpp index f72b550b27..15bc1246e6 100644 --- a/src/vcpkg-test/json.cpp +++ b/src/vcpkg-test/json.cpp @@ -12,12 +12,12 @@ // This is the worst, but we also can't really deal with it any other way. #if __cpp_char8_t template -static auto _u8_string_to_char_string(const char8_t (&literal)[Sz]) -> const char (&)[Sz] +static auto u8_string_to_char_string(const char8_t (&literal)[Sz]) -> const char (&)[Sz] { return reinterpret_cast(literal); } -#define U8_STR(s) (::vcpkg::Unicode::_u8_string_to_char_string(u8"" s)) +#define U8_STR(s) (u8_string_to_char_string(u8"" s)) #else #define U8_STR(s) (u8"" s) #endif