mirror of
https://github.com/nlohmann/json.git
synced 2025-11-24 03:44:06 +08:00
Add build step for ICPC (with fixes) (#3465)
* ⬆️ Doctest 2.4.7 * 👷 add CI step for ICPC * 👷 add CI step for ICPC * 👷 add CI step for ICPC * ⬇️ downgrade to Doctest 2.4.6 * 👷 add CI step for ICPC * 👷 add CI step for ICPC * 👷 add CI step for ICPC * 👷 add CI step for ICPC * 👷 add CI step for ICPC * 🔇 suppress warning #2196: routine is both "inline" and "noinline" * Re-enable <filesystem> detection on ICPC * Limit regression test for #3070 to Clang and GCC >=8.4 * Disable deprecation warnings on ICPC * Disable regression test for #1647 on ICPC (C++20) * Fix compilation failure of regression test for #3077 on ICPC * Disable wstring unit test on ICPC Fixes: error 913: invalid multibyte character sequence * Add ICPC to README Co-authored-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
committed by
GitHub
parent
0c698b75cc
commit
bdc21ad1a7
@@ -49,8 +49,12 @@ target_compile_options(test_main PUBLIC
|
||||
# https://github.com/nlohmann/json/issues/1114
|
||||
$<$<CXX_COMPILER_ID:MSVC>:/bigobj> $<$<BOOL:${MINGW}>:-Wa,-mbig-obj>
|
||||
|
||||
# https://github.com/nlohmann/json/pull/3229
|
||||
$<$<CXX_COMPILER_ID:Intel>:-diag-disable=2196>
|
||||
|
||||
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wno-deprecated;-Wno-float-equal>
|
||||
$<$<CXX_COMPILER_ID:GNU>:-Wno-deprecated-declarations>
|
||||
$<$<CXX_COMPILER_ID:Intel>:-diag-disable=1786>
|
||||
)
|
||||
target_include_directories(test_main PUBLIC
|
||||
thirdparty/doctest
|
||||
|
||||
@@ -512,12 +512,15 @@ TEST_CASE("regression tests 2")
|
||||
|
||||
SECTION("issue #1647 - compile error when deserializing enum if both non-default from_json and non-member operator== exists for other type")
|
||||
{
|
||||
// does not compile on ICPC when targeting C++20
|
||||
#if !(defined(__INTEL_COMPILER) && __cplusplus >= 202000)
|
||||
{
|
||||
json j;
|
||||
NonDefaultFromJsonStruct x(j);
|
||||
NonDefaultFromJsonStruct y;
|
||||
CHECK(x == y);
|
||||
}
|
||||
#endif
|
||||
|
||||
auto val = nlohmann::json("one").get<for_1647>();
|
||||
CHECK(val == for_1647::one);
|
||||
@@ -793,8 +796,8 @@ TEST_CASE("regression tests 2")
|
||||
const auto j_path = j.get<nlohmann::detail::std_fs::path>();
|
||||
CHECK(j_path == text_path);
|
||||
|
||||
#if !defined(_MSC_VER) && !(defined(__GNUC__) && __GNUC__ == 8 && __GNUC_MINOR__ < 4)
|
||||
// works everywhere but on MSVC and GCC <8.4
|
||||
#if defined(__clang__) || ((defined(__GNUC__) && !defined(__INTEL_COMPILER)) && (__GNUC__ > 8 || (__GNUC__ == 8 && __GNUC_MINOR__ >= 4)))
|
||||
// only known to work on Clang and GCC >=8.4
|
||||
CHECK_THROWS_WITH_AS(nlohmann::detail::std_fs::path(json(1)), "[json.exception.type_error.302] type must be string, but is number", json::type_error);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ SOFTWARE.
|
||||
#include <nlohmann/json.hpp>
|
||||
using nlohmann::json;
|
||||
|
||||
// ICPC errors out on multibyte character sequences in source files
|
||||
#ifndef __INTEL_COMPILER
|
||||
namespace
|
||||
{
|
||||
bool wstring_is_utf16();
|
||||
@@ -115,3 +117,4 @@ TEST_CASE("wide strings")
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user