Skip to content

Commit

Permalink
Merge pull request #2011 from sjanel/bugfix/fixclangcompilation
Browse files Browse the repository at this point in the history
Fix compilation error in clang 13 in C++20 mode - ambiguous call to log function
  • Loading branch information
gabime committed Jul 27, 2021
2 parents 816ede3 + aecdfc6 commit 5b4c4f3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/spdlog/logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,13 @@ class SPDLOG_API logger
log(loc, lvl, string_view_t{msg});
}

// T cannot be statically converted to niether string_view, neither wstring_view and niether to format string
template<class T, typename std::enable_if<!std::is_convertible<const T &, spdlog::string_view_t>::value
&& !is_convertible_to_basic_format_string<const T&>::value,
int>::type = 0>
// T cannot be statically converted to neither string_view, nor wstring_view and nor format string
template<class T, typename std::enable_if<!std::is_convertible<const T &, spdlog::string_view_t>::value &&
!is_convertible_to_basic_format_string<const T &>::value,
int>::type = 0>
void log(source_loc loc, level::level_enum lvl, const T &msg)
{
log(loc, lvl, "{}", msg);
log(loc, lvl, "{}", msg);
}

void log(log_clock::time_point log_time, source_loc loc, level::level_enum lvl, string_view_t msg)
Expand Down Expand Up @@ -141,7 +141,7 @@ class SPDLOG_API logger
{
log(source_loc{}, lvl, msg);
}

template<typename... Args>
void trace(fmt::format_string<Args...> fmt, Args &&...args)
{
Expand Down

0 comments on commit 5b4c4f3

Please sign in to comment.