From 7e3700f6508347cdaf32f5d97ff684c518ffdb97 Mon Sep 17 00:00:00 2001 From: Gabi Melman Date: Sun, 24 Dec 2023 18:38:40 +0200 Subject: [PATCH] force constexpr of empty source_loc --- include/spdlog/logger.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index f733507e..0190a4f3 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -77,7 +77,8 @@ public: template void log(level lvl, format_string_t fmt, Args &&...args) { if (should_log(lvl)) { - log_with_format_(source_loc{}, lvl, details::to_string_view(fmt), + constexpr source_loc empty_loc{}; + log_with_format_(empty_loc, lvl, details::to_string_view(fmt), std::forward(args)...); } } @@ -98,7 +99,8 @@ public: void log(level lvl, string_view_t msg) { if (should_log(lvl)) { - sink_it_(details::log_msg(source_loc{}, name_, lvl, msg)); + constexpr source_loc empty_loc{}; + sink_it_(details::log_msg(empty_loc, name_, lvl, msg)); } }