diff --git a/.github/external_ci/appveyor.yml b/.github/external_ci/appveyor.yml index 5c6b47a344..5c4af270ca 100644 --- a/.github/external_ci/appveyor.yml +++ b/.github/external_ci/appveyor.yml @@ -48,7 +48,7 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 configuration: Release platform: x86 - CXX_FLAGS: "/W4 /WX" + CXX_FLAGS: "/permissive- /std:c++latest /utf-8 /W4 /WX" CMAKE_OPTIONS: "-DJSON_ImplicitConversions=OFF" GENERATOR: Visual Studio 16 2019 diff --git a/include/nlohmann/detail/conversions/from_json.hpp b/include/nlohmann/detail/conversions/from_json.hpp index 363a649d50..a4a04aa9dd 100644 --- a/include/nlohmann/detail/conversions/from_json.hpp +++ b/include/nlohmann/detail/conversions/from_json.hpp @@ -47,7 +47,7 @@ inline void from_json(const BasicJsonType& j, typename std::nullptr_t& n) } #ifdef JSON_HAS_CPP_17 -#ifndef JSON_USE_IMPLICIT_CONVERSIONS +#if !JSON_USE_IMPLICIT_CONVERSIONS template void from_json(const BasicJsonType& j, std::optional& opt) { diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 3a8061ff6f..f89719562e 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -4832,7 +4832,7 @@ inline void from_json(const BasicJsonType& j, typename std::nullptr_t& n) } #ifdef JSON_HAS_CPP_17 -#ifndef JSON_USE_IMPLICIT_CONVERSIONS +#if !JSON_USE_IMPLICIT_CONVERSIONS template void from_json(const BasicJsonType& j, std::optional& opt) { diff --git a/tests/src/unit-conversions.cpp b/tests/src/unit-conversions.cpp index db5d44065f..09e88f4765 100644 --- a/tests/src/unit-conversions.cpp +++ b/tests/src/unit-conversions.cpp @@ -1683,7 +1683,7 @@ TEST_CASE("std::filesystem::path") } #endif -#ifndef JSON_USE_IMPLICIT_CONVERSIONS +#if !JSON_USE_IMPLICIT_CONVERSIONS TEST_CASE("std::optional") { SECTION("null")