From ff7ed18ac0d385b50c4059caa02cbc304f5e06e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?The=CC=81o=20Delrieu?= Date: Mon, 2 Dec 2024 15:32:46 +0100 Subject: [PATCH 1/2] optional: use #if instead of #ifndef, fixes #3859 --- include/nlohmann/detail/conversions/from_json.hpp | 2 +- single_include/nlohmann/json.hpp | 2 +- tests/src/unit-conversions.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/nlohmann/detail/conversions/from_json.hpp b/include/nlohmann/detail/conversions/from_json.hpp index 522292247..42240ea28 100644 --- a/include/nlohmann/detail/conversions/from_json.hpp +++ b/include/nlohmann/detail/conversions/from_json.hpp @@ -48,7 +48,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 02441416b..e45958b81 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -4721,7 +4721,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 9adbc935a..a713c93aa 100644 --- a/tests/src/unit-conversions.cpp +++ b/tests/src/unit-conversions.cpp @@ -1598,7 +1598,7 @@ TEST_CASE("JSON to enum mapping") #ifdef JSON_HAS_CPP_17 -#ifndef JSON_USE_IMPLICIT_CONVERSIONS +#if !JSON_USE_IMPLICIT_CONVERSIONS TEST_CASE("std::optional") { SECTION("null") From a73a7151a085c6a2e23c7e3546afcd27f92c33c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?The=CC=81o=20Delrieu?= Date: Thu, 12 Dec 2024 16:54:59 +0100 Subject: [PATCH 2/2] wip debug appveyor --- .github/external_ci/appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/external_ci/appveyor.yml b/.github/external_ci/appveyor.yml index 126ed99b3..ee05af37a 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