diff --git a/include/fmt/std.h b/include/fmt/std.h index 696662ae61cb..cd908dc99e17 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 33ac5e38872a..ab94209fa436 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