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

Version 3.10.3 breaks backward-compatibility with 3.10.2 #3070

Closed
2 of 5 tasks
TheAifam5 opened this issue Oct 9, 2021 · 2 comments · Fixed by #3073
Closed
2 of 5 tasks

Version 3.10.3 breaks backward-compatibility with 3.10.2 #3070

TheAifam5 opened this issue Oct 9, 2021 · 2 comments · Fixed by #3073
Assignees
Labels
confirmed kind: bug release item: 🐛 bug fix solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@TheAifam5
Copy link

TheAifam5 commented Oct 9, 2021

What is the issue you have?

Version 3.10.3 breaks backward-compatibility with 3.10.2.

Please describe the steps to reproduce the issue.

  1. Compile bear 3.0.16 with nlohmann/json 3.10.3
  2. Compilation will fail (logs below)
  3. Compile bear 3.0.16 with nlohmann/json 3.10.2
  4. Compilation will succeed

Can you provide a small but working code example?

What is the expected behavior?

Version 3.10.3 should be backwards-compatible with 3.10.2.

And what is the actual behavior instead?

Version 3.10.3 breaks backward-compatibility with codebase based on 3.10.0.

Which compiler and operating system are you using?

  • Compiler: gcc 11.2.0
  • Operating system: gentoo

Which version of the library did you use?

  • latest release version 3.10.3
  • other release - please state the version: ___
  • the develop branch

If you experience a compilation error: can you compile and run the unit tests?

  • yes
  • no - please copy/paste the error message below
cmake -C /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/gentoo_common_config.cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DENABLE_UNIT_TESTS=OFF -DENABLE_FUNC_TESTS=OFF -DCMAKE_BUILD_TYPE=Gentoo -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/gentoo_toolchain.cmake  /var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16
loading initial cache file /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/gentoo_common_config.cmake
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for nlohman_json dependency
-- Looking for nlohman_json dependency -- found
-- Looking for fmt dependency
-- Looking for fmt dependency -- found
-- Looking for spdlog dependency
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for spdlog dependency -- found
-- Looking for gRPC::grpc++ dependency
-- Found PkgConfig: x86_64-pc-linux-gnu-pkg-config (found version "1.8.0")
-- Checking for modules 'protobuf>=3.11;grpc++>=1.26'
--   Found protobuf, version 3.17.3
--   Found grpc++, version 1.41.0
-- Looking for gRPC::grpc++ dependency -- found
-- Looking for protoc
-- Looking for protoc -- found
-- Looking for grpc_cpp_plugin
-- Looking for grpc_cpp_plugin -- found
-- <<< Gentoo configuration >>>
Build type      Gentoo
Install path    /usr
Compiler flags:
C               -march=native -ggdb -O2 -pipe
C++             -march=native -ggdb -O2 -pipe
Linker flags:
Executable      -Wl,-O1 -Wl,--as-needed
Module          -Wl,-O1 -Wl,--as-needed
Shared          -Wl,-O1 -Wl,--as-needed

-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build
!!! Failed to set new SELinux execution context. Is your current SELinux context allowed to run Portage?
 * Source directory (CMAKE_USE_DIR): "/var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16"
 * Build directory  (BUILD_DIR):     "/var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build"
ninja -v -j16 -l12.0
[1/8] cd /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build && /usr/bin/cmake -E make_directory /var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source && /usr/bin/cmake -E make_directory /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Build/BearSource && /usr/bin/cmake -E make_directory /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Install/BearSource && /usr/bin/cmake -E make_directory /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/tmp/BearSource && /usr/bin/cmake -E make_directory /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Stamp/BearSource && /usr/bin/cmake -E make_directory /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Download/BearSource && /usr/bin/cmake -E make_directory /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Stamp/BearSource && /usr/bin/cmake -E touch /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Stamp/BearSource/BearSource-mkdir
[2/8] cd /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build && /usr/bin/cmake -E echo_append && /usr/bin/cmake -E touch /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Stamp/BearSource/BearSource-download
[3/8] cd /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build && /usr/bin/cmake -E echo_append && /usr/bin/cmake -E touch /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Stamp/BearSource/BearSource-update
[4/8] cd /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build && /usr/bin/cmake -E echo_append && /usr/bin/cmake -E touch /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Stamp/BearSource/BearSource-patch
[5/8] cd /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Build/BearSource && /usr/bin/cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_PROJECT_VERSION=3.0.16 -DCMAKE_C_COMPILER=/usr/bin/x86_64-pc-linux-gnu-gcc -DCMAKE_CXX_STANDARD=17 -DCMAKE_CXX_STANDARD_REQUIRED=ON -DCMAKE_CXX_EXTENSIONS=OFF "-DCMAKE_CXX_FLAGS:STRING=-march=native -ggdb -O2 -pipe" -DCMAKE_CXX_COMPILER:STRING=/usr/bin/x86_64-pc-linux-gnu-g++ -DPKG_CONFIG_EXECUTABLE:PATH=x86_64-pc-linux-gnu-pkg-config -DCMAKE_TOOLCHAIN_FILE:PATH=/var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/gentoo_toolchain.cmake -GNinja -C/var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/tmp/BearSource/BearSource-cache-Gentoo.cmake /var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source && /usr/bin/cmake -E touch /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Stamp/BearSource/BearSource-configure
loading initial cache file /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/tmp/BearSource/BearSource-cache-Gentoo.cmake
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/x86_64-pc-linux-gnu-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/x86_64-pc-linux-gnu-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found nlohmann_json: /usr/lib64/cmake/nlohmann_json/nlohmann_jsonConfig.cmake (found version "3.10.3")
-- Found PkgConfig: x86_64-pc-linux-gnu-pkg-config (found version "1.8.0")
-- Checking for modules 'protobuf;grpc++'
--   Found protobuf, version 3.17.3
--   Found grpc++, version 1.41.0
-- Looking for spawn.h
-- Looking for spawn.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for errno.h
-- Looking for errno.h - found
-- Looking for sys/utsname.h
-- Looking for sys/utsname.h - found
-- Looking for sys/wait.h
-- Looking for sys/wait.h - found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for gnu/lib-names.h
-- Looking for gnu/lib-names.h - found
-- Looking for _NSGetEnviron
-- Looking for _NSGetEnviron - not found
-- Looking for dlopen
-- Looking for dlopen - found
-- Looking for dlsym
-- Looking for dlsym - found
-- Looking for dlerror
-- Looking for dlerror - found
-- Looking for dlclose
-- Looking for dlclose - found
-- Looking for RTLD_NEXT
-- Looking for RTLD_NEXT - found
-- Looking for EACCES
-- Looking for EACCES - found
-- Looking for ENOENT
-- Looking for ENOENT - found
-- Looking for strerror_r
-- Looking for strerror_r - found
-- Looking for environ
-- Looking for environ - found
-- Looking for uname
-- Looking for uname - found
-- Looking for confstr
-- Looking for confstr - found
-- Looking for _CS_PATH
-- Looking for _CS_PATH - found
-- Looking for _CS_GNU_LIBC_VERSION
-- Looking for _CS_GNU_LIBC_VERSION - found
-- Looking for _CS_GNU_LIBPTHREAD_VERSION
-- Looking for _CS_GNU_LIBPTHREAD_VERSION - found
-- Looking for protoc ... /usr/bin/protoc
-- Looking for grpc_cpp_plugin ... /usr/bin/grpc_cpp_plugin
-- Configuring done
-- Generating done
-- Build files have been written to: /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Build/BearSource
[6/8] cd /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Build/BearSource && /usr/bin/cmake --build . && /usr/bin/cmake -E touch /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Stamp/BearSource/BearSource-build
FAILED: subprojects/Stamp/BearSource/BearSource-build /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Stamp/BearSource/BearSource-build
cd /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Build/BearSource && /usr/bin/cmake --build . && /usr/bin/cmake -E touch /var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Stamp/BearSource/BearSource-build
[1/61] Building CXX object intercept/CMakeFiles/exec.dir/source/report/libexec/std.cc.o
[2/61] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Environment.cc.o
[3/61] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Buffer.cc.o
[4/61] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Logger.cc.o
[5/61] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Session.cc.o
[6/61] Generating supervise.pb.h, supervise.grpc.pb.h, supervise.pb.cc, supervise.grpc.pb.cc
[7/61] Generating intercept.pb.h, intercept.grpc.pb.h, intercept.pb.cc, intercept.grpc.pb.cc
[8/61] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Errors.cc.o
[9/61] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Paths.cc.o
[10/61] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Linker.cc.o
[11/61] Building CXX object intercept/CMakeFiles/exec.dir/source/report/libexec/lib.cc.o
[12/61] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Resolver.cc.o
[13/61] Building CXX object intercept/CMakeFiles/exec_a.dir/source/report/libexec/Executor.cc.o
[14/61] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Guard.cc.o
[15/61] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Path.cc.o
[16/61] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Os.cc.o
[17/61] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Signal.cc.o
[18/61] Building CXX object intercept/CMakeFiles/domain_a.dir/source/Domain.cc.o
[19/61] Building CXX object intercept/CMakeFiles/wrapper_a.dir/source/report/wrapper/EventFactory.cc.o
[20/61] Building CXX object intercept/CMakeFiles/events_db_a.dir/source/collect/db/EventsDatabaseWriter.cc.o
[21/61] Building CXX object libflags/CMakeFiles/flags_a.dir/source/Flags.cc.o
[22/61] Building CXX object intercept/CMakeFiles/domain_a.dir/source/Convert.cc.o
[23/61] Building CXX object intercept/CMakeFiles/events_db_a.dir/source/collect/db/EventsDatabaseReader.cc.o
[24/61] Building CXX object citnames/CMakeFiles/citnames_json_a.dir/source/Output.cc.o
FAILED: citnames/CMakeFiles/citnames_json_a.dir/source/Output.cc.o
/usr/bin/x86_64-pc-linux-gnu-g++ -DFMT_LOCALE -DFMT_SHARED -DJSON_DIAGNOSTICS=0 -DJSON_USE_IMPLICIT_CONVERSIONS=1 -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DSPDLOG_SHARED_LIB -I/var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Build/BearSource -I/var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/libresult/include -I/var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/libshell/include -I/var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/libsys/include -march=native -ggdb -O2 -pipe -fno-exceptions -DSPDLOG_NO_EXCEPTIONS -DGOOGLE_PROTOBUF_NO_RTTI -Wall -Wextra -fexceptions -std=c++17 -MD -MT citnames/CMakeFiles/citnames_json_a.dir/source/Output.cc.o -MF citnames/CMakeFiles/citnames_json_a.dir/source/Output.cc.o.d -o citnames/CMakeFiles/citnames_json_a.dir/source/Output.cc.o -c /var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/citnames/source/Output.cc
In file included from /usr/include/nlohmann/detail/conversions/from_json.hpp:19,
                 from /usr/include/nlohmann/adl_serializer.hpp:6,
                 from /usr/include/nlohmann/json.hpp:51,
                 from /var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/citnames/source/Output.cc:30:
/usr/include/nlohmann/detail/meta/type_traits.hpp: In instantiation of ‘constexpr const bool nlohmann::detail::is_constructible_array_type_impl<nlohmann::basic_json<>, std::filesystem::__cxx11::path, void>::value’:
/usr/include/nlohmann/detail/conversions/from_json.hpp:245:84:   required by substitution of ‘template<class BasicJsonType, class ConstructibleArrayType, typename std::enable_if<((((nlohmann::detail::is_constructible_array_type<BasicJsonType, ConstructibleArrayType>::value && (! nlohmann::detail::is_constructible_object_type<BasicJsonType, ConstructibleObjectType>::value)) && (! nlohmann::detail::is_constructible_string_type<BasicJsonType, ConstructibleStringType>::value)) && (! std::is_same<ConstructibleArrayType, typename BasicJsonType::binary_t>::value)) && (! nlohmann::detail::is_basic_json<T>::value)), int>::type <anonymous> > decltype (((nlohmann::detail::from_json_array_impl(j, arr, nlohmann::detail::priority_tag<3>{}), j.get<typename ConstructibleArrayType::value_type>()), void())) nlohmann::detail::from_json(const BasicJsonType&, ConstructibleArrayType&) [with BasicJsonType = nlohmann::basic_json<>; ConstructibleArrayType = std::filesystem::__cxx11::path; typename std::enable_if<((((nlohmann::detail::is_constructible_array_type<BasicJsonType, ConstructibleArrayType>::value && (! nlohmann::detail::is_constructible_object_type<BasicJsonType, ConstructibleObjectType>::value)) && (! nlohmann::detail::is_constructible_string_type<BasicJsonType, ConstructibleStringType>::value)) && (! std::is_same<ConstructibleArrayType, typename BasicJsonType::binary_t>::value)) && (! nlohmann::detail::is_basic_json<T>::value)), int>::type <anonymous> = <missing>]’
/usr/include/nlohmann/detail/conversions/from_json.hpp:452:26:   required by substitution of ‘template<class BasicJsonType, class T> decltype (nlohmann::detail::from_json(j, forward<T>(val))) nlohmann::detail::from_json_fn::operator()(const BasicJsonType&, T&&) const [with BasicJsonType = nlohmann::basic_json<>; T = std::filesystem::__cxx11::path&]’
/usr/include/nlohmann/adl_serializer.hpp:31:38:   required by substitution of ‘template<class BasicJsonType, class TargetType> static decltype ((nlohmann::{anonymous}::from_json(forward<BasicJsonType>(j), val), void())) nlohmann::adl_serializer<std::filesystem::__cxx11::path, void>::from_json<BasicJsonType, TargetType>(BasicJsonType&&, TargetType&) [with BasicJsonType = const nlohmann::basic_json<>&; TargetType = std::filesystem::__cxx11::path]’
/usr/include/nlohmann/detail/meta/detected.hpp:55:7:   recursively required by substitution of ‘template<class Default, template<class ...> class Op, class ... Args> struct nlohmann::detail::detector<Default, typename nlohmann::detail::make_void<Op<Args ...> >::type, Op, Args ...> [with Default = nlohmann::detail::nonesuch; Op = nlohmann::detail::from_json_function; Args = {nlohmann::adl_serializer<std::filesystem::__cxx11::path, void>, const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >&, std::filesystem::__cxx11::path&}]’
/usr/include/nlohmann/detail/meta/detected.hpp:55:7:   required by substitution of ‘template<class Expected, template<class ...> class Op, class ... Args> using is_detected_exact = std::is_same<Expected, typename nlohmann::detail::detector<nlohmann::detail::nonesuch, void, Op, Args ...>::type> [with Expected = void; Op = nlohmann::detail::from_json_function; Args = {nlohmann::adl_serializer<std::filesystem::__cxx11::path, void>, const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >&, std::filesystem::__cxx11::path&}]’
/usr/include/nlohmann/detail/meta/type_traits.hpp:115:36:   required from ‘constexpr const bool nlohmann::detail::has_from_json<nlohmann::basic_json<>, std::filesystem::__cxx11::path, void>::value’
/usr/include/nlohmann/json.hpp:3289:60:   required by substitution of ‘template<class ValueType, typename std::enable_if<((! nlohmann::detail::is_basic_json<BasicJsonType>::value) && nlohmann::detail::has_from_json<nlohmann::basic_json<>, ValueType, void>::value), int>::type <anonymous> > ValueType& nlohmann::basic_json<>::get_to<ValueType, <anonymous> >(ValueType&) const [with ValueType = std::filesystem::__cxx11::path; typename std::enable_if<((! nlohmann::detail::is_basic_json<BasicJsonType>::value) && nlohmann::detail::has_from_json<nlohmann::basic_json<>, ValueType, void>::value), int>::type <anonymous> = <missing>]’
/var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/citnames/source/Output.cc:164:28:   required from here
/usr/include/nlohmann/detail/meta/type_traits.hpp:400:22: error: the value of ‘nlohmann::detail::has_from_json<nlohmann::basic_json<>, std::filesystem::__cxx11::path, void>::value’ is not usable in a constant expression
  400 |         value_type>::value ||
      |                      ^~~~~
In file included from /usr/include/nlohmann/detail/conversions/from_json.hpp:19,
                 from /usr/include/nlohmann/adl_serializer.hpp:6,
                 from /usr/include/nlohmann/json.hpp:51,
                 from /var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/citnames/source/Output.cc:30:
/usr/include/nlohmann/detail/meta/type_traits.hpp:113:27: note: ‘nlohmann::detail::has_from_json<nlohmann::basic_json<>, std::filesystem::__cxx11::path, void>::value’ used in its own initializer
  113 |     static constexpr bool value =
      |                           ^~~~~
[25/61] Building CXX object citnames/CMakeFiles/citnames_json_a.dir/source/Configuration.cc.o
FAILED: citnames/CMakeFiles/citnames_json_a.dir/source/Configuration.cc.o
/usr/bin/x86_64-pc-linux-gnu-g++ -DFMT_LOCALE -DFMT_SHARED -DJSON_DIAGNOSTICS=0 -DJSON_USE_IMPLICIT_CONVERSIONS=1 -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DSPDLOG_SHARED_LIB -I/var/tmp/portage/dev-util/bear-3.0.16/work/bear-3.0.16_build/subprojects/Build/BearSource -I/var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/libresult/include -I/var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/libshell/include -I/var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/libsys/include -march=native -ggdb -O2 -pipe -fno-exceptions -DSPDLOG_NO_EXCEPTIONS -DGOOGLE_PROTOBUF_NO_RTTI -Wall -Wextra -fexceptions -std=c++17 -MD -MT citnames/CMakeFiles/citnames_json_a.dir/source/Configuration.cc.o -MF citnames/CMakeFiles/citnames_json_a.dir/source/Configuration.cc.o.d -o citnames/CMakeFiles/citnames_json_a.dir/source/Configuration.cc.o -c /var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/citnames/source/Configuration.cc
In file included from /usr/include/nlohmann/detail/conversions/from_json.hpp:19,
                 from /usr/include/nlohmann/adl_serializer.hpp:6,
                 from /usr/include/nlohmann/json.hpp:51,
                 from /var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/citnames/source/Configuration.cc:26:
/usr/include/nlohmann/detail/meta/type_traits.hpp: In instantiation of ‘constexpr const bool nlohmann::detail::is_constructible_array_type_impl<nlohmann::basic_json<>, std::filesystem::__cxx11::path, void>::value’:
/usr/include/nlohmann/detail/conversions/from_json.hpp:245:84:   required by substitution of ‘template<class BasicJsonType, class ConstructibleArrayType, typename std::enable_if<((((nlohmann::detail::is_constructible_array_type<BasicJsonType, ConstructibleArrayType>::value && (! nlohmann::detail::is_constructible_object_type<BasicJsonType, ConstructibleObjectType>::value)) && (! nlohmann::detail::is_constructible_string_type<BasicJsonType, ConstructibleStringType>::value)) && (! std::is_same<ConstructibleArrayType, typename BasicJsonType::binary_t>::value)) && (! nlohmann::detail::is_basic_json<T>::value)), int>::type <anonymous> > decltype (((nlohmann::detail::from_json_array_impl(j, arr, nlohmann::detail::priority_tag<3>{}), j.get<typename ConstructibleArrayType::value_type>()), void())) nlohmann::detail::from_json(const BasicJsonType&, ConstructibleArrayType&) [with BasicJsonType = nlohmann::basic_json<>; ConstructibleArrayType = std::filesystem::__cxx11::path; typename std::enable_if<((((nlohmann::detail::is_constructible_array_type<BasicJsonType, ConstructibleArrayType>::value && (! nlohmann::detail::is_constructible_object_type<BasicJsonType, ConstructibleObjectType>::value)) && (! nlohmann::detail::is_constructible_string_type<BasicJsonType, ConstructibleStringType>::value)) && (! std::is_same<ConstructibleArrayType, typename BasicJsonType::binary_t>::value)) && (! nlohmann::detail::is_basic_json<T>::value)), int>::type <anonymous> = <missing>]’
/usr/include/nlohmann/detail/conversions/from_json.hpp:452:26:   required by substitution of ‘template<class BasicJsonType, class T> decltype (nlohmann::detail::from_json(j, forward<T>(val))) nlohmann::detail::from_json_fn::operator()(const BasicJsonType&, T&&) const [with BasicJsonType = nlohmann::basic_json<>; T = std::filesystem::__cxx11::path&]’
/usr/include/nlohmann/adl_serializer.hpp:31:38:   required by substitution of ‘template<class BasicJsonType, class TargetType> static decltype ((nlohmann::{anonymous}::from_json(forward<BasicJsonType>(j), val), void())) nlohmann::adl_serializer<std::filesystem::__cxx11::path, void>::from_json<BasicJsonType, TargetType>(BasicJsonType&&, TargetType&) [with BasicJsonType = const nlohmann::basic_json<>&; TargetType = std::filesystem::__cxx11::path]’
/usr/include/nlohmann/detail/meta/type_traits.hpp:89:49:   required by substitution of ‘template<class T, class ... Args> using from_json_function = decltype (T::from_json((declval<Args>)()...)) [with T = nlohmann::adl_serializer<std::filesystem::__cxx11::path, void>; Args = {const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >&, std::filesystem::__cxx11::path&}]’
/usr/include/nlohmann/detail/meta/detected.hpp:55:7:   [ skipping 4 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/usr/include/nlohmann/detail/conversions/from_json.hpp:452:26:   required by substitution of ‘template<class BasicJsonType, class T> decltype (nlohmann::detail::from_json(j, forward<T>(val))) nlohmann::detail::from_json_fn::operator()(const BasicJsonType&, T&&) const [with BasicJsonType = nlohmann::basic_json<>; T = std::__cxx11::list<std::filesystem::__cxx11::path>&]’
/usr/include/nlohmann/adl_serializer.hpp:31:38:   required by substitution of ‘template<class BasicJsonType, class TargetType> static decltype ((nlohmann::{anonymous}::from_json(forward<BasicJsonType>(j), val), void())) nlohmann::adl_serializer<std::__cxx11::list<std::filesystem::__cxx11::path>, void>::from_json<BasicJsonType, TargetType>(BasicJsonType&&, TargetType&) [with BasicJsonType = const nlohmann::basic_json<>&; TargetType = std::__cxx11::list<std::filesystem::__cxx11::path>]’
/usr/include/nlohmann/detail/meta/detected.hpp:55:7:   recursively required by substitution of ‘template<class Default, template<class ...> class Op, class ... Args> struct nlohmann::detail::detector<Default, typename nlohmann::detail::make_void<Op<Args ...> >::type, Op, Args ...> [with Default = nlohmann::detail::nonesuch; Op = nlohmann::detail::from_json_function; Args = {nlohmann::adl_serializer<std::__cxx11::list<std::filesystem::__cxx11::path, std::allocator<std::filesystem::__cxx11::path> >, void>, const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >&, std::__cxx11::list<std::filesystem::__cxx11::path, std::allocator<std::filesystem::__cxx11::path> >&}]’
/usr/include/nlohmann/detail/meta/detected.hpp:55:7:   required by substitution of ‘template<class Expected, template<class ...> class Op, class ... Args> using is_detected_exact = std::is_same<Expected, typename nlohmann::detail::detector<nlohmann::detail::nonesuch, void, Op, Args ...>::type> [with Expected = void; Op = nlohmann::detail::from_json_function; Args = {nlohmann::adl_serializer<std::__cxx11::list<std::filesystem::__cxx11::path, std::allocator<std::filesystem::__cxx11::path> >, void>, const nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >&, std::__cxx11::list<std::filesystem::__cxx11::path, std::allocator<std::filesystem::__cxx11::path> >&}]’
/usr/include/nlohmann/detail/meta/type_traits.hpp:115:36:   required from ‘constexpr const bool nlohmann::detail::has_from_json<nlohmann::basic_json<>, std::__cxx11::list<std::filesystem::__cxx11::path>, void>::value’
/usr/include/nlohmann/json.hpp:3289:60:   required by substitution of ‘template<class ValueType, typename std::enable_if<((! nlohmann::detail::is_basic_json<BasicJsonType>::value) && nlohmann::detail::has_from_json<nlohmann::basic_json<>, ValueType, void>::value), int>::type <anonymous> > ValueType& nlohmann::basic_json<>::get_to<ValueType, <anonymous> >(ValueType&) const [with ValueType = std::__cxx11::list<std::filesystem::__cxx11::path>; typename std::enable_if<((! nlohmann::detail::is_basic_json<BasicJsonType>::value) && nlohmann::detail::has_from_json<nlohmann::basic_json<>, ValueType, void>::value), int>::type <anonymous> = <missing>]’
/var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/citnames/source/Configuration.cc:46:44:   required from here
/usr/include/nlohmann/detail/meta/type_traits.hpp:400:22: error: the value of ‘nlohmann::detail::has_from_json<nlohmann::basic_json<>, std::filesystem::__cxx11::path, void>::value’ is not usable in a constant expression
  400 |         value_type>::value ||
      |                      ^~~~~
In file included from /usr/include/nlohmann/detail/conversions/from_json.hpp:19,
                 from /usr/include/nlohmann/adl_serializer.hpp:6,
                 from /usr/include/nlohmann/json.hpp:51,
                 from /var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/citnames/source/Configuration.cc:26:
/usr/include/nlohmann/detail/meta/type_traits.hpp:113:27: note: ‘nlohmann::detail::has_from_json<nlohmann::basic_json<>, std::filesystem::__cxx11::path, void>::value’ used in its own initializer
  113 |     static constexpr bool value =
      |                           ^~~~~
In file included from /usr/include/nlohmann/detail/conversions/from_json.hpp:19,
                 from /usr/include/nlohmann/adl_serializer.hpp:6,
                 from /usr/include/nlohmann/json.hpp:51,
                 from /var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/citnames/source/Configuration.cc:26:
/usr/include/nlohmann/detail/meta/type_traits.hpp: In instantiation of ‘constexpr const bool nlohmann::detail::is_compatible_array_type_impl<nlohmann::basic_json<>, std::filesystem::__cxx11::path, void>::value’:
/usr/include/nlohmann/detail/conversions/to_json.hpp:310:48:   required by substitution of ‘template<class BasicJsonType, class CompatibleArrayType, typename std::enable_if<((((nlohmann::detail::is_compatible_array_type<BasicJsonType, CompatibleArrayType>::value && (! nlohmann::detail::is_compatible_object_type<BasicJsonType, CompatibleObjectType>::value)) && (! nlohmann::detail::is_compatible_string_type<BasicJsonType, ConstructibleStringType>::value)) && (! std::is_same<typename BasicJsonType::binary_t, CompatibleArrayType>::value)) && (! nlohmann::detail::is_basic_json<T>::value)), int>::type <anonymous> > void nlohmann::detail::to_json(BasicJsonType&, const CompatibleArrayType&) [with BasicJsonType = nlohmann::basic_json<>; CompatibleArrayType = std::filesystem::__cxx11::path; typename std::enable_if<((((nlohmann::detail::is_compatible_array_type<BasicJsonType, CompatibleArrayType>::value && (! nlohmann::detail::is_compatible_object_type<BasicJsonType, CompatibleObjectType>::value)) && (! nlohmann::detail::is_compatible_string_type<BasicJsonType, ConstructibleStringType>::value)) && (! std::is_same<typename BasicJsonType::binary_t, CompatibleArrayType>::value)) && (! nlohmann::detail::is_basic_json<T>::value)), int>::type <anonymous> = <missing>]’
/usr/include/nlohmann/detail/conversions/to_json.hpp:393:24:   required by substitution of ‘template<class BasicJsonType, class T> decltype ((nlohmann::detail::to_json(j, forward<T>(val)), void())) nlohmann::detail::to_json_fn::operator()(BasicJsonType&, T&&) const [with BasicJsonType = nlohmann::basic_json<>; T = std::filesystem::__cxx11::path]’
/usr/include/nlohmann/adl_serializer.hpp:68:36:   required by substitution of ‘template<class BasicJsonType, class TargetType> static decltype ((nlohmann::{anonymous}::to_json(j, forward<TargetType>(val)), void())) nlohmann::adl_serializer<std::filesystem::__cxx11::path, void>::to_json<BasicJsonType, TargetType>(BasicJsonType&, TargetType&&) [with BasicJsonType = nlohmann::basic_json<>; TargetType = std::filesystem::__cxx11::path]’
/usr/include/nlohmann/detail/meta/type_traits.hpp:86:45:   required by substitution of ‘template<class T, class ... Args> using to_json_function = decltype (T::to_json((declval<Args>)()...)) [with T = nlohmann::adl_serializer<std::filesystem::__cxx11::path, void>; Args = {nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >&, std::filesystem::__cxx11::path}]’
/usr/include/nlohmann/detail/meta/detected.hpp:55:7:   [ skipping 10 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
/usr/include/nlohmann/adl_serializer.hpp:68:36:   required by substitution of ‘template<class BasicJsonType, class TargetType> static decltype ((nlohmann::{anonymous}::to_json(j, forward<TargetType>(val)), void())) nlohmann::adl_serializer<std::__cxx11::list<std::filesystem::__cxx11::path>, void>::to_json<BasicJsonType, TargetType>(BasicJsonType&, TargetType&&) [with BasicJsonType = nlohmann::basic_json<>; TargetType = std::__cxx11::list<std::filesystem::__cxx11::path>]’
/usr/include/nlohmann/detail/meta/detected.hpp:55:7:   recursively required by substitution of ‘template<class Default, template<class ...> class Op, class ... Args> struct nlohmann::detail::detector<Default, typename nlohmann::detail::make_void<Op<Args ...> >::type, Op, Args ...> [with Default = nlohmann::detail::nonesuch; Op = nlohmann::detail::to_json_function; Args = {nlohmann::adl_serializer<std::__cxx11::list<std::filesystem::__cxx11::path, std::allocator<std::filesystem::__cxx11::path> >, void>, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >&, std::__cxx11::list<std::filesystem::__cxx11::path, std::allocator<std::filesystem::__cxx11::path> >}]’
/usr/include/nlohmann/detail/meta/detected.hpp:55:7:   required by substitution of ‘template<class Expected, template<class ...> class Op, class ... Args> using is_detected_exact = std::is_same<Expected, typename nlohmann::detail::detector<nlohmann::detail::nonesuch, void, Op, Args ...>::type> [with Expected = void; Op = nlohmann::detail::to_json_function; Args = {nlohmann::adl_serializer<std::__cxx11::list<std::filesystem::__cxx11::path, std::allocator<std::filesystem::__cxx11::path> >, void>, nlohmann::basic_json<std::map, std::vector, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, bool, long int, long unsigned int, double, std::allocator, nlohmann::adl_serializer, std::vector<unsigned char, std::allocator<unsigned char> > >&, std::__cxx11::list<std::filesystem::__cxx11::path, std::allocator<std::filesystem::__cxx11::path> >}]’
/usr/include/nlohmann/detail/meta/type_traits.hpp:145:13:   required from ‘constexpr const bool nlohmann::detail::has_to_json<nlohmann::basic_json<>, std::__cxx11::list<std::filesystem::__cxx11::path>, void>::value’
/usr/include/nlohmann/detail/meta/type_traits.hpp:446:53:   required from ‘constexpr const bool nlohmann::detail::is_compatible_type_impl<nlohmann::basic_json<>, std::__cxx11::list<std::filesystem::__cxx11::path>, void>::value’
/usr/include/nlohmann/json.hpp:1569:53:   required by substitution of ‘template<class CompatibleType, class U, typename std::enable_if<((! nlohmann::detail::is_basic_json<T>::value) && nlohmann::detail::is_compatible_type<nlohmann::basic_json<>, U>::value), int>::type <anonymous> > nlohmann::basic_json<>::basic_json(CompatibleType&&) [with CompatibleType = const std::__cxx11::list<std::filesystem::__cxx11::path>&; U = std::__cxx11::list<std::filesystem::__cxx11::path>; typename std::enable_if<((! nlohmann::detail::is_basic_json<T>::value) && nlohmann::detail::is_compatible_type<nlohmann::basic_json<>, U>::value), int>::type <anonymous> = <missing>]’
/var/tmp/portage/dev-util/bear-3.0.16/work/Bear-3.0.16/source/citnames/source/Configuration.cc:58:41:   required from here
/usr/include/nlohmann/detail/meta/type_traits.hpp:362:46: error: incomplete type ‘nlohmann::detail::is_constructible<nlohmann::basic_json<>, std::filesystem::__cxx11::path>’ used in nested name specifier
  362 |         range_value_t<CompatibleArrayType>>::value;
      |                                              ^~~~~
[26/61] Building CXX object intercept/CMakeFiles/wrapper_a.dir/source/report/wrapper/EventReporter.cc.o
[27/61] Building CXX object libmain/CMakeFiles/main_a.dir/source/ApplicationLogConfig.cc.o
[28/61] Building CXX object libmain/CMakeFiles/main_a.dir/source/ApplicationFromArgs.cc.o
[29/61] Building CXX object libsys/CMakeFiles/sys_a.dir/source/Process.cc.o
[30/61] Building CXX object intercept/CMakeFiles/intercept_a.dir/source/collect/RpcServices.cc.o
[31/61] Building CXX object intercept/CMakeFiles/intercept.dir/source/collect/main.cc.o
[32/61] Building CXX object intercept/proto/CMakeFiles/rpc_a.dir/intercept.grpc.pb.cc.o
[33/61] Building CXX object libshell/CMakeFiles/shell_a.dir/source/Command.cc.o
[34/61] Building CXX object intercept/CMakeFiles/wrapper.dir/source/report/wrapper/main.cc.o
[35/61] Building CXX object intercept/CMakeFiles/wrapper_a.dir/source/report/wrapper/RpcClients.cc.o
[36/61] Building CXX object intercept/CMakeFiles/intercept_a.dir/source/collect/Reporter.cc.o
[37/61] Building CXX object intercept/CMakeFiles/intercept_a.dir/source/collect/Session.cc.o
[38/61] Building CXX object intercept/CMakeFiles/intercept_a.dir/source/collect/SessionLibrary.cc.o
[39/61] Building CXX object intercept/CMakeFiles/wrapper_a.dir/source/report/wrapper/Application.cc.o
[40/61] Building CXX object intercept/CMakeFiles/intercept_a.dir/source/collect/SessionWrapper.cc.o
[41/61] Building CXX object intercept/CMakeFiles/intercept_a.dir/source/collect/Application.cc.o
ninja: build stopped: subcommand failed.
ninja: build stopped: subcommand failed.
@nlohmann
Copy link
Owner

nlohmann commented Oct 9, 2021

Any ideas on this @theodelrieu ?

@theodelrieu
Copy link
Contributor

I can reproduce, on it.

theodelrieu added a commit to theodelrieu/json that referenced this issue Oct 11, 2021
Antiquated type traits performed an incorrect and insufficient check.

std::filesystem::path used to work by "chance" thanks to brittle
constraints, but the clean-up performed in nlohmann#3020 broke these.

Fixes nlohmann#3070
theodelrieu added a commit to theodelrieu/json that referenced this issue Oct 13, 2021
theodelrieu added a commit to theodelrieu/json that referenced this issue Oct 13, 2021
theodelrieu added a commit to theodelrieu/json that referenced this issue Oct 14, 2021
@nlohmann nlohmann self-assigned this Oct 14, 2021
@nlohmann nlohmann added confirmed release item: 🐛 bug fix solution: proposed fix a fix for the issue has been proposed and waits for confirmation labels Oct 14, 2021
@nlohmann nlohmann added this to the Release 3.10.4 milestone Oct 14, 2021
nlohmann pushed a commit that referenced this issue Oct 14, 2021
* meta: rework is_compatible/is_constructible_string_type

These type traits performed an incorrect and insufficient check.

Converting to a std::filesystem::path used to work by accident thanks to
these brittle constraints, but the clean-up performed in #3020 broke them.

* support std::filesystem::path

Fixes #3070
gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Oct 17, 2021
Upstream-issue:  nlohmann/json#3070
Bear-issue: rizsotto/Bear#420
Bug: https://bugs.gentoo.org/817233
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 5, 2022
Move definition of common macros (e.g., JSON_HAS_CPP_*) into macros.hpp
header file and update unit test sources.

Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked here: nlohmann#3377
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 5, 2022
Move definition of common macros (e.g., JSON_HAS_CPP_*) into macros.hpp
header file and update unit test sources.

Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled, which is tracked here: nlohmann#3377
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 6, 2022
Move definition of common macros (e.g., JSON_HAS_CPP_*) into macros.hpp
header file and update unit test sources.

Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled, which is tracked here: nlohmann#337
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 6, 2022
Move definition of common macros (e.g., JSON_HAS_CPP_*) into macros.hpp
header file and update unit test sources.

Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled, which is tracked here: nlohmann#337
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 6, 2022
Move definition of common macros (e.g., JSON_HAS_CPP_*) into macros.hpp
header file and update unit test sources.

Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled, which is tracked here: nlohmann#337
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 6, 2022
Move definition of common macros (e.g., JSON_HAS_CPP_*) into macros.hpp
header file and update unit test sources.

Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked in nlohmann#3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 6, 2022
Move definition of common macros (e.g., JSON_HAS_CPP_*) into macros.hpp
header file and update unit test sources.

Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked in nlohmann#3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 6, 2022
Move definition of common macros (e.g., JSON_HAS_CPP_*) into macros.hpp
header file and update unit test sources.

Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked in nlohmann#3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 7, 2022
Move definition of common macros (e.g., JSON_HAS_CPP_*) into macros.hpp
header file and update unit test sources.

Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked in nlohmann#3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 8, 2022
Move definition of common macros (e.g., JSON_HAS_CPP_*) into macros.hpp
header file and update unit test sources.

Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked in nlohmann#3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 9, 2022
Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked in nlohmann#3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 9, 2022
Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked in nlohmann#3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 9, 2022
Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked in nlohmann#3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 9, 2022
Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked in nlohmann#3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 9, 2022
Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked in nlohmann#3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 9, 2022
Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked in nlohmann#3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 10, 2022
Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked in nlohmann#3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 10, 2022
Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked in nlohmann#3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 13, 2022
Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked in nlohmann#3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Mar 13, 2022
Incidentally enables the regression tests for nlohmann#2546 and nlohmann#3070.

A CHECK_THROWS_WITH_AS in nlohmann#3070 was disabled which is tracked in nlohmann#3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.
nlohmann pushed a commit that referenced this issue Mar 24, 2022
* Refactor unit test creation

Add functions for creating tests and to supply test- and
standard-specific build settings.

Raises minimum CMake version to 3.13 in test directory.

json_test_add_test_for(
    <file>
    MAIN <main>
    [CXX_STANDARDS <version_number>...] [FORCE])

Given a <file> unit-foo.cpp, produces

    test-foo_cpp<version_number>

if C++ standard <version_number> is supported by the compiler and
thesource file contains JSON_HAS_CPP_<version_number>.  Use FORCE to
create the test regardless of the file containing
JSON_HAS_CPP_<version_number>.  Test targets are linked against <main>.
CXX_STANDARDS defaults to "11".

json_test_set_test_options(
    all|<tests>
    [CXX_STANDARDS all|<args>...]
    [COMPILE_DEFINITIONS <args>...]
    [COMPILE_FEATURES <args>...]
    [COMPILE_OPTIONS <args>...]
    [LINK_LIBRARIES <args>...]
    [LINK_OPTIONS <args>...])

Supply test- and standard-specific build settings.
Specify multiple tests using a list e.g., "test-foo;test-bar".

Must be called BEFORE the test is created.

* Use CMAKE_MODULE_PATH

* Don't undef some macros if JSON_TEST_KEEP_MACROS is defined

* Use JSON_TEST_KEEP_MACROS

Incidentally enables the regression tests for #2546 and #3070.

A CHECK_THROWS_WITH_AS in #3070 was disabled which is tracked in #3377
and a line in from_json(..., std_fs::path&) was marked with LCOV_EXCL_LINE.

* Add three-way comparison feature test macro

* Disable broken comparison if JSON_HAS_THREE_WAY_COMPARISON

* Fix redefinition of inline constexpr statics

Redelcaration of inline constexpr static data members in namespace scope
was deprecated in C++17. Fixes -Werror=deprecated compilation failures.

* Fix more test build failures due to missing noexcept

* CI: update cmake_flags test to use CMake 3.13 in test directory

Also change default for JSON_BuildTests option to depend on CMake
version.

* CI: turn *_CXXFLAGS into CMake lists

* CI: use JSON_TestStandards to set CXX_STANDARD

* CI: pass extra CXXFLAGS to standards tests
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Apr 5, 2022
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Apr 5, 2022
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Apr 5, 2022
Restore the previously disabled check for regression nlohmann#3070 on all
compilers but MSVC.

To summarize the issue:
Given namespace fs = std::filesystem.
On MSVC attempting to construct an fs::path from json results in an
ambiguous overload resolution because fs::path can be constructed from
both a std::string as well as another fs::path.
To the best of my knowledge there is no way to fix an ambiguous overload
situation involving a type we do not control and with json implicitly
converting to both std::string and fs::path.

Re-enabling the check where it compiles and keeping it disabled for MSVC
is the best we can do.

Closes nlohmann#3377 and nlohmann#3382.
nlohmann pushed a commit that referenced this issue Apr 6, 2022
Restore the previously disabled check for regression #3070 on all
compilers but MSVC.

To summarize the issue:
Given namespace fs = std::filesystem.
On MSVC attempting to construct an fs::path from json results in an
ambiguous overload resolution because fs::path can be constructed from
both a std::string as well as another fs::path.
To the best of my knowledge there is no way to fix an ambiguous overload
situation involving a type we do not control and with json implicitly
converting to both std::string and fs::path.

Re-enabling the check where it compiles and keeping it disabled for MSVC
is the best we can do.

Closes #3377 and #3382.
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue Apr 22, 2022
falbrechtskirchinger added a commit to falbrechtskirchinger/json that referenced this issue May 1, 2022
nlohmann added a commit that referenced this issue May 1, 2022
* ⬆️ 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed kind: bug release item: 🐛 bug fix solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants