From 514b6955d22be65a72dfbae526ab75330382c75e Mon Sep 17 00:00:00 2001 From: Vladislav Shchapov Date: Wed, 19 Jun 2024 20:49:43 +0500 Subject: [PATCH] Suppress a bogus warning in MSVC (#4023) Signed-off-by: Vladislav Shchapov --- include/fmt/std.h | 8 +++++--- test/ranges-test.cc | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/fmt/std.h b/include/fmt/std.h index 696662ae..cd908dc9 100644 --- a/include/fmt/std.h +++ b/include/fmt/std.h @@ -35,9 +35,11 @@ # if FMT_HAS_INCLUDE() # include # endif -# if FMT_HAS_INCLUDE() -# include -# endif +# endif +// Use > instead of >= in the version check because may be +// available after C++17 but before C++20 is marked as implemented. +# if FMT_CPLUSPLUS > 201703L && FMT_HAS_INCLUDE() +# include # endif # if FMT_CPLUSPLUS > 202002L && FMT_HAS_INCLUDE() # include diff --git a/test/ranges-test.cc b/test/ranges-test.cc index 33ac5e38..ab94209f 100644 --- a/test/ranges-test.cc +++ b/test/ranges-test.cc @@ -17,7 +17,7 @@ #include #include -#if FMT_HAS_INCLUDE() +#if FMT_CPLUSPLUS > 201703L && FMT_HAS_INCLUDE() # include #endif