From dcaf81de9ce887cf5bdd0461533e4364fd468ca5 Mon Sep 17 00:00:00 2001 From: Altanb21 <94198465+Altanb21@users.noreply.github.com> Date: Wed, 10 Aug 2022 20:31:00 +0300 Subject: [PATCH] Update core.h C++ 20 build error fix --- include/fmt/core.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index 13a0edf2..8756f1bd 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -273,7 +273,7 @@ # endif #endif -#ifndef FMT_USE_NONTYPE_TEMPLATE_ARGS +#ifndef FMT_USE_NONTYPE_TEMPLATE_ARGS && !defined(__INTELLISENSE__) # if defined(__cpp_nontype_template_args) && \ ((FMT_GCC_VERSION >= 903 && FMT_CPLUSPLUS >= 201709L) || \ __cpp_nontype_template_args >= 201911L) @@ -2904,7 +2904,7 @@ template class specs_checker : public Handler { constexpr int invalid_arg_index = -1; -#if FMT_USE_NONTYPE_TEMPLATE_ARGS +#if FMT_USE_NONTYPE_TEMPLATE_ARGS && !defined(__INTELLISENSE__) template constexpr auto get_arg_index_by_name(basic_string_view name) -> int { if constexpr (detail::is_statically_named_arg()) { @@ -2919,7 +2919,7 @@ constexpr auto get_arg_index_by_name(basic_string_view name) -> int { template FMT_CONSTEXPR auto get_arg_index_by_name(basic_string_view name) -> int { -#if FMT_USE_NONTYPE_TEMPLATE_ARGS +#if FMT_USE_NONTYPE_TEMPLATE_ARGS && !defined(__INTELLISENSE__) if constexpr (sizeof...(Args) > 0) return get_arg_index_by_name<0, Args...>(name); #endif @@ -2960,7 +2960,7 @@ class format_string_checker { return context_.check_arg_id(id), id; } FMT_CONSTEXPR auto on_arg_id(basic_string_view id) -> int { -#if FMT_USE_NONTYPE_TEMPLATE_ARGS +#if FMT_USE_NONTYPE_TEMPLATE_ARGS && !defined(__INTELLISENSE__) auto index = get_arg_index_by_name(id); if (index == invalid_arg_index) on_error("named argument is not found"); return context_.check_arg_id(index), index;