-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Description
Description
The NVHPC compilers usually enforce the language-standards more strictly than other compilers, but on the other hand they may only be in synch with standards that aren't the latest.
The errors listed below, are there some settings that I need to use to get around them?
Reproduction steps
1405 ARG VERSION_JSON=3.11.3
1406
1407 RUN cd /usr/local/src &&
1408 mkdir distro build &&
1409 curl --retry 5 -fSsL "https://github.com/nlohmann/json/archive/refs/tags/v${VERSION_JSON}.tar.gz" | tar -C distro --strip-components=1 -xz &&
1410 cd build &&
1411 cmake -S ../distro -DCMAKE_INSTALL_PREFIX=/usr/local &&
1412 make install &&
1413 cd - &&
1414 rm -Rf /usr/local/src/*
Expected vs. actual results
#74 339.6 CHECK_THROWS_WITH_AS(j << ss, "[json.exception.parse_error.101] parse error at line 1, column 29: syntax error while parsing array - unexpected end of input; expected ']'", json::parse_error&);
#74 600.8 [ 45%] Building CXX object tests/CMakeFiles/test-iterators2_cpp20.dir/src/unit-iterators2.cpp.o
#74 603.1 "/usr/include/c++/11/ranges", line 1753: error: a constexpr function cannot have a nonliteral return type "std::__success_type<nlohmann::json_abi_v3_11_3::detail::iteration_proxy_value<nlohmann::json_abi_v3_11_3::detail::iter_impl<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::string, bool, int64_t, uint64_t, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<uint8_t, std::allocator<uint8_t>>, void>>>::string_type>::type" (aka "std::string")
#74 603.1 {
#74 603.1 ^
#74 603.1 detected during instantiation of class "std::ranges::transform_view<_Vp, _Fp>::_Iterator<_Const> [with _Vp=std::ranges::subrange<nlohmann::json_abi_v3_11_3::detail::iteration_proxy_value<nlohmann::json_abi_v3_11_3::detail::iter_impl<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::string, bool, int64_t, uint64_t, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<uint8_t, std::allocator<uint8_t>>, void>>>, nlohmann::json_abi_v3_11_3::detail::iteration_proxy_value<nlohmann::json_abi_v3_11_3::detail::iter_impl<nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::string, bool, int64_t, uint64_t, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<uint8_t, std::allocator<uint8_t>>, void>>>, std::ranges::subrange_kind::unsized>, _Fp=lambda [](const auto &)->auto, _Const=false]" at line 963 of "/usr/local/src/distro/tests/src/unit-iterators2.cpp"
#74 603.1
#74 604.3 1 error detected in the compilation of "/usr/local/src/distro/tests/src/unit-iterators2.cpp".
#74 604.3 make[2]: *** [tests/CMakeFiles/test-iterators2_cpp20.dir/build.make:79: tests/CMakeFiles/test-iterators2_cpp20.dir/src/unit-iterators2.cpp.o] Error 2
#74 604.3 make[1]: *** [CMakeFiles/Makefile2:2712: tests/CMakeFiles/test-iterators2_cpp20.dir/all] Error 2
#74 604.3 make: *** [Makefile:146: all] Error 2
Minimal code example
Error messages
There are also these warning messages:
#74 42.12 [ 6%] Building CXX object tests/CMakeFiles/test-binary_formats_cpp11.dir/src/unit-binary_formats.cpp.o
#74 43.43 "/usr/local/src/distro/include/nlohmann/detail/output/binary_writer.hpp", line 966: warning: statement is unreachable [code_is_unreachable]
#74 43.43 static_cast<void>(j);
#74 43.43 ^
#74 43.43 detected during:
#74 43.43 instantiation of "std::size_t nlohmann::json_abi_v3_11_3::detail::binary_writer<BasicJsonType, CharType>::calc_bson_element_size(const nlohmann::json_abi_v3_11_3::detai
l::binary_writer<BasicJsonType, CharType>::string_t &, const BasicJsonType &) [with BasicJsonType=nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::string, bool, int64_t, ui
nt64_t, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<uint8_t, std::allocator<uint8_t>>, void>, CharType=uint8_t]" at line 1264
#74 87.64 [ 9%] Building CXX object tests/CMakeFiles/test-bson_cpp11.dir/src/unit-bson.cpp.o
#74 88.73 "/usr/local/src/distro/tests/src/unit-bson.cpp", line 1267: warning: function "nlohmann::json_abi_v3_11_3::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType, CustomBaseClass>::from_bson(nlohmann::json_abi_v3_11_3::detail::span_input_adapter &&, bool, bool) [with ObjectType=std::map, ArrayType=std::vector, StringType=std::string, BooleanType=bool, NumberIntegerType=int64_t, NumberUnsignedType=uint64_t, NumberFloatType=double, AllocatorType=std::allocator, JSONSerializer=nlohmann::json_abi_v3_11_3::adl_serializer, BinaryType=std::vector<uint8_t, std::allocator<uint8_t>>, CustomBaseClass=void]" was declared deprecated ("Since 3.8.0; use from_bson(ptr, ptr + len)") [deprecated_entity_with_custom_message]
#74 88.73 CHECK_NOTHROW(j2 = json::from_bson({packed.data(), packed.size()}));
#74 88.73 ^
#74 88.73 "/usr/local/src/distro/include/nlohmann/json.hpp", line 4595: note: because of a "deprecated" attribute
#74 88.73 JSON_HEDLEY_DEPRECATED_FOR(3.8.0, from_bson(ptr, ptr + len))
#74 88.73 ^
#74 339.6 "/usr/local/src/distro/tests/src/unit-deserialization.cpp", line 370: warning: function "nlohmann::json_abi_v3_11_3::operator<<(nlohmann::json_abi_v3_11_3::basic_json<std::map, std::vector, std::string, bool, int64_t, uint64_t, double, std::allocator, nlohmann::json_abi_v3_11_3::adl_serializer, std::vector<uint8_t, std::allocator<uint8_t>>, void> &, std::istream &)" was declared deprecated ("Since 3.0.0; use operator>>(std::istream&, basic_json&)") [deprecated_entity_with_custom_message]
#74 339.6 CHECK_THROWS_WITH_AS(j << ss, "[json.exception.parse_error.101] parse error at line 1, column 29: syntax error while parsing array - unexpected end of input; expected ']'", json::parse_error&);
#74 339.6 ^Compiler and operating system
NHPHC 25.1 compilers. Ubuntu 22.04 OS.
Library version
3.11.3
Validation
- The bug also occurs if the latest version from the
developbranch is used. - I can successfully compile and run the unit tests.