Closed
Description
Unit tests test-conversions_cpp14
and test-items_cpp14
fail to build with Clang <4.0. C++11 builds are fine and starting with version 4.0 the C++14 builds succeed as well.
I've disabled these tests in #3380.
Edit: In fact, simply compiling an empty main()
including json.hpp
fails, meaning this is unrelated to the specific tests but C++14 in general.
[36/117] Building CXX object test/CMakeFiles/test-conversions_cpp14.dir/src/unit-conversions.cpp.o
FAILED: test/CMakeFiles/test-conversions_cpp14.dir/src/unit-conversions.cpp.o
/usr/bin/clang++-3.9 -DDOCTEST_CONFIG_SUPER_FAST_ASSERTS -DJSON_DIAGNOSTICS=0 -DJSON_TEST_KEEP_MACROS -DJSON_USE_IMPLICIT_CONVERSIONS=1 -I/__w/json/json/test/thirdparty/doctest -I/__w/json/json/test/thirdparty/fifo_map -I/__w/json/json/build/build_compiler_clang++-3.9/include -I/__w/json/json/single_include -g -Wno-deprecated -Wno-float-equal -std=gnu++14 -MD -MT test/CMakeFiles/test-conversions_cpp14.dir/src/unit-conversions.cpp.o -MF test/CMakeFiles/test-conversions_cpp14.dir/src/unit-conversions.cpp.o.d -o test/CMakeFiles/test-conversions_cpp14.dir/src/unit-conversions.cpp.o -c /__w/json/json/test/src/unit-conversions.cpp
In file included from /__w/json/json/test/src/unit-conversions.cpp:30:
In file included from /__w/json/json/test/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /__w/json/json/test/thirdparty/doctest/doctest.h:404:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/ciso646:37:
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/x86_64-linux-gnu/c++/11/bits/c++config.h:558:2: warning: "__STRICT_ANSI__ seems to have been undefined; this is not supported" [-W#warnings]
#warning "__STRICT_ANSI__ seems to have been undefined; this is not supported"
^
In file included from /__w/json/json/test/src/unit-conversions.cpp:33:
/__w/json/json/single_include/nlohmann/json.hpp:3941:7: error: overload resolution selected deleted operator '='
s = *j.template get_ptr<const typename BasicJsonType::string_t*>();
~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/__w/json/json/single_include/nlohmann/json.hpp:4301:16: note: in instantiation of function template specialization 'nlohmann::detail::from_json<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, nlohmann::detail::json_ref<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > >, 0>' requested here
return from_json(j, std::forward<T>(val));
^
/__w/json/json/single_include/nlohmann/json.hpp:4962:9: note: in instantiation of function template specialization 'nlohmann::detail::from_json_fn::operator()<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, nlohmann::detail::json_ref<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > &>' requested here
::nlohmann::from_json(std::forward<BasicJsonType>(j), val);
^
/__w/json/json/single_include/nlohmann/json.hpp:18802:36: note: in instantiation of function template specialization 'nlohmann::adl_serializer<nlohmann::detail::json_ref<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > >, void>::from_json<const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > &, nlohmann::detail::json_ref<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > >' requested here
JSONSerializer<ValueType>::from_json(*this, ret);
^
/__w/json/json/single_include/nlohmann/json.hpp:18945:16: note: in instantiation of function template specialization 'nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >::get_impl<nlohmann::detail::json_ref<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > >, 0>' requested here
return get_impl<ValueType>(detail::priority_tag<4> {});
^
/__w/json/json/single_include/nlohmann/json.hpp:13135:15: note: candidate function has been explicitly deleted
json_ref& operator=(json_ref&&) = delete;
^
/__w/json/json/single_include/nlohmann/json.hpp:13134:15: note: candidate function has been explicitly deleted
json_ref& operator=(const json_ref&) = delete;
^
In file included from /__w/json/json/test/src/unit-conversions.cpp:33:
In file included from /__w/json/json/single_include/nlohmann/json.hpp:46:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/algorithm:61:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_algobase.h:67:
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_iterator.h:918:20: error: no member named 'insert' in 'std::initializer_list<nlohmann::detail::json_ref<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > >'
iter = container->insert(iter, std::move(__value));
~~~~~~~~~ ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_algo.h:4[296](https://github.com/falbrechtskirchinger/json/runs/5480997789?check_suite_focus=true#step:5:296):12: note: in instantiation of member function 'std::insert_iterator<std::initializer_list<nlohmann::detail::json_ref<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > > >::operator=' requested here
*__result = __unary_op(*__first);
^
/__w/json/json/single_include/nlohmann/json.hpp:4066:10: note: in instantiation of function template specialization 'std::transform<nlohmann::detail::iter_impl<const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > >, std::insert_iterator<std::initializer_list<nlohmann::detail::json_ref<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > > >, (lambda at /__w/json/json/single_include/nlohmann/json.hpp:4068:9)>' requested here
std::transform(
^
/__w/json/json/single_include/nlohmann/json.hpp:4095:5: note: in instantiation of function template specialization 'nlohmann::detail::from_json_array_impl<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, std::initializer_list<nlohmann::detail::json_ref<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > >, 0>' requested here
from_json_array_impl(j, arr, priority_tag<3> {});
^
/__w/json/json/single_include/nlohmann/json.hpp:4301:16: note: in instantiation of function template specialization 'nlohmann::detail::from_json<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, std::initializer_list<nlohmann::detail::json_ref<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > >, 0>' requested here
return from_json(j, std::forward<T>(val));
^
/__w/json/json/single_include/nlohmann/json.hpp:4962:9: note: in instantiation of function template specialization 'nlohmann::detail::from_json_fn::operator()<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, std::initializer_list<nlohmann::detail::json_ref<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > > &>' requested here
::nlohmann::from_json(std::forward<BasicJsonType>(j), val);
^
/__w/json/json/single_include/nlohmann/json.hpp:18802:36: note: in instantiation of function template specialization 'nlohmann::adl_serializer<std::initializer_list<nlohmann::detail::json_ref<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > >, void>::from_json<const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > &, std::initializer_list<nlohmann::detail::json_ref<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > > >' requested here
JSONSerializer<ValueType>::from_json(*this, ret);
^
/__w/json/json/single_include/nlohmann/json.hpp:18945:16: note: in instantiation of function template specialization 'nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >::get_impl<std::initializer_list<nlohmann::detail::json_ref<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > >, 0>' requested here
return get_impl<ValueType>(detail::priority_tag<4> {});
^
In file included from /__w/json/json/test/src/unit-conversions.cpp:33:
In file included from /__w/json/json/single_include/nlohmann/json.hpp:46:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/algorithm:61:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_algobase.h:67:
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_iterator.h:918:20: error: no member named 'insert' in 'std::initializer_list<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > >'
iter = container->insert(iter, std::move(__value));
~~~~~~~~~ ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/11/../../../../include/c++/11/bits/stl_algo.h:4296:12: note: in instantiation of member function 'std::insert_iterator<std::initializer_list<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > >::operator=' requested here
*__result = __unary_op(*__first);
^
/__w/json/json/single_include/nlohmann/json.hpp:4066:10: note: in instantiation of function template specialization 'std::transform<nlohmann::detail::iter_impl<const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > >, std::insert_iterator<std::initializer_list<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > >, (lambda at /__w/json/json/single_include/nlohmann/json.hpp:4068:9)>' requested here
std::transform(
^
/__w/json/json/single_include/nlohmann/json.hpp:4095:5: note: in instantiation of function template specialization 'nlohmann::detail::from_json_array_impl<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, std::initializer_list<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > >, 0>' requested here
from_json_array_impl(j, arr, priority_tag<3> {});
^
/__w/json/json/single_include/nlohmann/json.hpp:4301:16: note: in instantiation of function template specialization 'nlohmann::detail::from_json<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, std::initializer_list<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > >, 0>' requested here
return from_json(j, std::forward<T>(val));
^
/__w/json/json/single_include/nlohmann/json.hpp:4962:9: note: in instantiation of function template specialization 'nlohmann::detail::from_json_fn::operator()<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, std::initializer_list<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > &>' requested here
::nlohmann::from_json(std::forward<BasicJsonType>(j), val);
^
/__w/json/json/single_include/nlohmann/json.hpp:18802:36: note: (skipping 4 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
JSONSerializer<ValueType>::from_json(*this, ret);
^
/__w/json/json/single_include/nlohmann/json.hpp:4095:5: note: in instantiation of function template specialization 'nlohmann::detail::from_json_array_impl<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, std::__cxx11::list<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, std::allocator<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > >, 0>' requested here
from_json_array_impl(j, arr, priority_tag<3> {});
^
/__w/json/json/single_include/nlohmann/json.hpp:4301:16: note: in instantiation of function template specialization 'nlohmann::detail::from_json<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, std::__cxx11::list<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, std::allocator<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > >, 0>' requested here
return from_json(j, std::forward<T>(val));
^
/__w/json/json/single_include/nlohmann/json.hpp:4962:9: note: in instantiation of function template specialization 'nlohmann::detail::from_json_fn::operator()<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, std::__cxx11::list<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, std::allocator<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > > &>' requested here
::nlohmann::from_json(std::forward<BasicJsonType>(j), val);
^
/__w/json/json/single_include/nlohmann/json.hpp:18802:36: note: in instantiation of function template specialization 'nlohmann::adl_serializer<std::__cxx11::list<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, std::allocator<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > >, void>::from_json<const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > &, std::__cxx11::list<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, std::allocator<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > > >' requested here
JSONSerializer<ValueType>::from_json(*this, ret);
^
/__w/json/json/single_include/nlohmann/json.hpp:18945:16: note: in instantiation of function template specialization 'nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >::get_impl<std::__cxx11::list<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >, std::allocator<nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char>, bool, long, unsigned long, double, std::allocator, adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > > > >, 0>' requested here
return get_impl<ValueType>(detail::priority_tag<4> {});
^
1 warning and 3 errors generated.