Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit tests conversions & items fail to build (Clang <4.0/C++14 only) #3384

Closed
falbrechtskirchinger opened this issue Mar 9, 2022 · 8 comments · Fixed by #3427
Closed

Unit tests conversions & items fail to build (Clang <4.0/C++14 only) #3384

falbrechtskirchinger opened this issue Mar 9, 2022 · 8 comments · Fixed by #3427
Assignees
Labels
kind: bug release item: 🐛 bug fix solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@falbrechtskirchinger
Copy link
Contributor

falbrechtskirchinger commented Mar 9, 2022

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.
@falbrechtskirchinger
Copy link
Contributor Author

Fixing this is going to be a requirement for #3385 I just realized.

@falbrechtskirchinger
Copy link
Contributor Author

Alright, the test suit never compiled the code with Clang <4.0 in C++14 mode and no one seems to have complained about it. After spending about an hour on this with no luck I'm leaning towards blanket disabling C++14 for Clang <4.0 and am going to implement that change in #3380.

Any objections? @nlohmann

@nlohmann
Copy link
Owner

The library targets C++11, so we used to not care too much about C++14/C++17/C++20. We only added tests for C++ beyond 2011 lately - in particular for added C++17 features. These tests only take a "recent" compiler rather than testing each and every compiler version here.

To summarize: I do not care too much whether older compilers are C++14 compliant.

@nlohmann nlohmann added the state: please discuss please discuss the issue or vote for your favorite option label Mar 14, 2022
@gcerretani
Copy link
Contributor

gcerretani commented Mar 18, 2022

Clang 3.9 supports C++14 decently. This bug drops support for Clang < 4.0 from projects that uses this library and are written in C++14. Please, consider fix this.

Here the test on godbolt with clang 3.9.1: https://godbolt.org/z/WPEnxGEsG

@gcerretani
Copy link
Contributor

I've checked that v3.10.3 with clang 3.9.1/C++14 is fine. The bug has been introduced in v3.10.4.

@gcerretani
Copy link
Contributor

The bug has been introduced with commit 0e694b4. Version at previous commit (4b1cb9e) works.

mahge added a commit to mahge/OpenModelica that referenced this issue Mar 18, 2022
  - The json reader (v3.10.5) added for parmodlica does not compile with
    clang < 4.0.
    Downgrade it to v3.10.3 which compiles fine and provides everything
    we needed anyway.

    Upstream issue: nlohmann/json#3384
mahge added a commit to OpenModelica/OpenModelica that referenced this issue Mar 18, 2022
  - The json reader (v3.10.5) added for parmodlica does not compile with
    clang < 4.0.
    Downgrade it to v3.10.3 which compiles fine and provides everything
    we needed anyway.

    Upstream issue: nlohmann/json#3384
@falbrechtskirchinger
Copy link
Contributor Author

The bug has been introduced with commit 0e694b4. Version at previous commit (4b1cb9e) works.

Thanks for tracking the bad commit down. I'll take a look at some related stuff soon and maybe I'll fix it incidentally.

@falbrechtskirchinger
Copy link
Contributor Author

So the good news is that this might be fixable with a single line. I haven't run it through CI yet, only tested it locally with clang 3.9.1 and GCC 12.

falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Apr 6, 2022
Constrain from_json() overload for ConstructibleStringType to not accept
json_ref and require assignability.

Re-enable C++14 tests on Clang <4.0.

Fixes nlohmann#3171, nlohmann#3312, nlohmann#3384.
Maybe fixes nlohmann#3267.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Apr 6, 2022
Constrain from_json() overload for ConstructibleStringType to not accept
json_ref and require it to be assignable from basic_json::string_t.

Re-enable C++14 tests on Clang <4.0.

Fixes nlohmann#3171.
Fixes nlohmann#3267.
Fixes nlohmann#3312.
Fixes nlohmann#3384.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Apr 7, 2022
Constrain from_json() overload for StringType to not accept json_ref and
require it to be assignable, instead of constructible, from
basic_json::string_t.

Re-enable C++14 tests on Clang <4.0.

Fixes nlohmann#3171.
Fixes nlohmann#3267.
Fixes nlohmann#3312.
Fixes nlohmann#3384.
@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Apr 7, 2022
@nlohmann nlohmann self-assigned this Apr 8, 2022
@nlohmann nlohmann added this to the Release 3.11.0 milestone Apr 8, 2022
@nlohmann nlohmann added release item: 🐛 bug fix and removed state: please discuss please discuss the issue or vote for your favorite option labels Apr 8, 2022
nlohmann pushed a commit that referenced this issue Apr 8, 2022
Constrain from_json() overload for StringType to not accept json_ref and
require it to be assignable, instead of constructible, from
basic_json::string_t.

Re-enable C++14 tests on Clang <4.0.

Fixes #3171.
Fixes #3267.
Fixes #3312.
Fixes #3384.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug release item: 🐛 bug fix solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
3 participants