From 8a55b17751af73679124192e868841cf8132c58c Mon Sep 17 00:00:00 2001 From: stickies-v Date: Fri, 17 Apr 2026 13:59:18 +0100 Subject: [PATCH] util: make SourceLocation constructor explicit Follow CppCoreGuidelines C.46: https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#rc-explicit --- src/util/log.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util/log.h b/src/util/log.h index 1bec49f2298..641b81ff353 100644 --- a/src/util/log.h +++ b/src/util/log.h @@ -23,8 +23,9 @@ public: /// The func argument must be constructed from the C++11 __func__ macro. /// Ref: https://en.cppreference.com/w/cpp/language/function.html#func /// Non-static string literals are not supported. - SourceLocation(const char* func, - std::source_location loc = std::source_location::current()) + explicit SourceLocation( + const char* func, + std::source_location loc = std::source_location::current()) : m_func{func}, m_loc{loc} {} std::string_view file_name() const { return m_loc.file_name(); }