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

tests fail to build with clang-19 and libc++ due to unsupported std::char_traits #4490

Closed
1 of 2 tasks
paparodeo opened this issue Nov 10, 2024 · 3 comments · Fixed by #4495
Closed
1 of 2 tasks

tests fail to build with clang-19 and libc++ due to unsupported std::char_traits #4490

paparodeo opened this issue Nov 10, 2024 · 3 comments · Fixed by #4495
Labels
confirmed kind: bug solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@paparodeo
Copy link

paparodeo commented Nov 10, 2024

Description

when using clang-19 with libc++ the build fails to build the tests

In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:24:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:561:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  561 |   typedef typename traits_type::int_type int_type;
      |                    ^
...
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

https://releases.llvm.org/19.1.0/projects/libcxx/docs/ReleaseNotes.html

The base template for std::char_traits has been removed in LLVM 19. If you are using std::char_traits with types other than char, wchar_t, char8_t, char16_t, char32_t or a custom character type for which you specialized std::char_traits, your code will stop working. The Standard does not mandate that a base template is provided, and such a base template is bound to be incorrect for some types, which could currently cause unexpected behavior while going undetected.

Reproduction steps

nix-build -E 'with import <nixpkgs>{}; nlohmann_json.override { stdenv = llvmPackages_19.libcxxStdenv; }'

Expected vs. actual results

expect build to succeed like it does when using an earlier clang / libc++ combination.

Minimal code example

failing tests are:

  • unit-bson.cpp
  • unit-cbor.cpp
  • unit-deserialization.cpp
  • unit-msgpack.cpp
  • unit-regression2.cpp

Error messages

Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/balg02bsn0aazljy4yilygkm8piy26m6-source
source root is source
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
fixing cmake files...
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_LOCALEDIR=/nix/store/kaqk1fmxalr5l55ld6hgxq75b1s85qzf-nlohmann_json-3.11.3/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/kaqk1fmxalr5l55ld6hgxq75b1s85qzf-nlohmann_json-3.11.3/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/kaqk1fmxalr5l55ld6hgxq75b1s85qzf-nlohmann_json-3.11.3/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/kaqk1fmxalr5l55ld6hgxq75b1s85qzf-nlohmann_json-3.11.3/share/doc/nlohmann_json -DCMAKE_INSTALL_INFODIR=/nix/store/kaqk1fmxalr5l55ld6hgxq75b1s85qzf-nlohmann_json-3.11.3/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/kaqk1fmxalr5l55ld6hgxq75b1s85qzf-nlohmann_json-3.11.3/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/kaqk1fmxalr5l55ld6hgxq75b1s85qzf-nlohmann_json-3.11.3/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/kaqk1fmxalr5l55ld6hgxq75b1s85qzf-nlohmann_json-3.11.3/include -DCMAKE_INSTALL_SBINDIR=/nix/store/kaqk1fmxalr5l55ld6hgxq75b1s85qzf-nlohmann_json-3.11.3/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/kaqk1fmxalr5l55ld6hgxq75b1s85qzf-nlohmann_json-3.11.3/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/kaqk1fmxalr5l55ld6hgxq75b1s85qzf-nlohmann_json-3.11.3/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/rr0b7ssq38nvjqm1ski5s840ipv37xvv-clang-wrapper-19.1.1/bin/strip -DCMAKE_RANLIB=/nix/store/rr0b7ssq38nvjqm1ski5s840ipv37xvv-clang-wrapper-19.1.1/bin/ranlib -DCMAKE_AR=/nix/store/rr0b7ssq38nvjqm1ski5s840ipv37xvv-clang-wrapper-19.1.1/bin/ar -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_INSTALL_PREFIX=/nix/store/kaqk1fmxalr5l55ld6hgxq75b1s85qzf-nlohmann_json-3.11.3 -DJSON_BuildTests=ON -DJSON_FastTests=ON -DJSON_MultipleHeaders=ON -DJSON_TestDataDirectory=/nix/store/xq70ff8j7f89k1hc0yxz57q9h7qxcvk4-source
-- The CXX compiler identification is Clang 19.1.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/rr0b7ssq38nvjqm1ski5s840ipv37xvv-clang-wrapper-19.1.1/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using the multi-header code from /build/source/include/
-- Using test data in /nix/store/xq70ff8j7f89k1hc0yxz57q9h7qxcvk4-source.
-- Operating system: Linux-6.8.0-45-generic; Linux localhost 6.8.0-45-generic #45~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Sep 11 15:25:05 UTC 2 x86_64 GNU/Linux
-- Compiler: clang version 19.1.1; Target: x86_64-unknown-linux-gnu; Thread model: posix; InstalledDir: /nix/store/v4nvxy5xh97n7ds79ig6l9z4pkk1fpv9-clang-19.1.1/bin
-- Testing standards: 11 14 17 20 23
-- Looking for C++ include sys/types.h
-- Looking for C++ include sys/types.h - found
-- Looking for C++ include stdint.h
-- Looking for C++ include stdint.h - found
-- Looking for C++ include stddef.h
-- Looking for C++ include stddef.h - found
-- Check size of size_t
-- Check size of size_t - done
-- Configuring done (0.9s)
-- Generating done (0.1s)
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_C_COMPILER
    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
    CMAKE_FIND_USE_PACKAGE_REGISTRY
    CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY
    CMAKE_POLICY_DEFAULT_CMP0025


-- Build files have been written to: /build/source/build
cmake: enabled parallel building
cmake: enabled parallel installing
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
build flags: -j16 SHELL=/nix/store/mm0pa3z7kk6jh1i9rkxqxjqmd8h1qpxf-bash-5.2p37/bin/bash
[  0%] Building CXX object tests/abi/diag/CMakeFiles/abi_compat_diag_off.dir/diag_off.cpp.o
[  1%] Building CXX object tests/CMakeFiles/test_main.dir/src/unit.cpp.o
[  1%] Building CXX object tests/abi/CMakeFiles/abi_compat_main.dir/main.cpp.o
[  1%] Building CXX object tests/abi/diag/CMakeFiles/abi_compat_diag_on.dir/diag_on.cpp.o
[  2%] Linking CXX static library libabi_compat_diag_off.a
[  2%] Built target abi_compat_diag_off
[  3%] Linking CXX static library libabi_compat_diag_on.a
[  3%] Built target abi_compat_diag_on
[  4%] Linking CXX static library libabi_compat_main.a
[  4%] Built target abi_compat_main
[  6%] Building CXX object tests/abi/config/CMakeFiles/abi_config_custom.dir/custom.cpp.o
[  6%] Building CXX object tests/abi/config/CMakeFiles/abi_config_default.dir/default.cpp.o
[  7%] Building CXX object tests/abi/diag/CMakeFiles/abi_compat_diag.dir/diag.cpp.o
[  7%] Built target test_main
[  7%] Building CXX object tests/abi/config/CMakeFiles/abi_config_noversion.dir/noversion.cpp.o
[  8%] Building CXX object tests/abi/inline_ns/CMakeFiles/abi_compat_inline_ns.dir/use_v3_10_5.cpp.o
[  8%] Building CXX object tests/abi/inline_ns/CMakeFiles/abi_compat_inline_ns.dir/use_current.cpp.o
[  9%] Building CXX object tests/CMakeFiles/test-algorithms_cpp11.dir/src/unit-algorithms.cpp.o
[  8%] Building CXX object tests/CMakeFiles/test-allocator_cpp11.dir/src/unit-allocator.cpp.o
[  9%] Building CXX object tests/CMakeFiles/test-assert_macro_cpp11.dir/src/unit-assert_macro.cpp.o
[ 11%] Building CXX object tests/CMakeFiles/test-alt-string_cpp11.dir/src/unit-alt-string.cpp.o
[ 11%] Building CXX object tests/CMakeFiles/test-binary_formats_cpp11.dir/src/unit-binary_formats.cpp.o
[ 11%] Building CXX object tests/CMakeFiles/test-bjdata_cpp11.dir/src/unit-bjdata.cpp.o
[ 11%] Building CXX object tests/CMakeFiles/test-bson_cpp11.dir/src/unit-bson.cpp.o
[ 12%] Building CXX object tests/CMakeFiles/test-byte_container_with_subtype_cpp11.dir/src/unit-byte_container_with_subtype.cpp.o
[ 13%] Building CXX object tests/CMakeFiles/test-capacity_cpp11.dir/src/unit-capacity.cpp.o
[ 14%] Building CXX object tests/CMakeFiles/test-cbor_cpp11.dir/src/unit-cbor.cpp.o
[ 15%] Linking CXX executable abi_compat_diag
[ 15%] Built target abi_compat_diag
In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:24:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:561:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  561 |   typedef typename traits_type::int_type int_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:40:59: note: in instantiation of template class 'std::basic_ios<unsigned char>' requested here
   40 | class _LIBCPP_TEMPLATE_VIS basic_ostream : virtual public basic_ios<_CharT, _Traits> {
      |                                                           ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:986:57: note: in instantiation of template class 'std::basic_ostream<unsigned char>' requested here
  986 | class _LIBCPP_TEMPLATE_VIS basic_ostringstream : public basic_ostream<_CharT, _Traits> {
      |                                                         ^
/build/source/tests/src/unit-bson.cpp:624:52: note: in instantiation of template class 'std::basic_ostringstream<unsigned char>' requested here
  624 |             std::basic_ostringstream<std::uint8_t> ss;
      |                                                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:24:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:562:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  562 |   typedef typename traits_type::pos_type pos_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:24:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:563:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  563 |   typedef typename traits_type::off_type off_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:24:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:565:42: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  565 |   static_assert(is_same<_CharT, typename traits_type::char_type>::value,
      |                                          ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:24:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:543:64: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  543 |   _LIBCPP_HIDE_FROM_ABI _SentinelValueFill& operator=(typename _Traits::int_type __x) {
      |                                                                ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:629:21: note: in instantiation of template class 'std::_SentinelValueFill<std::char_traits<unsigned char>>' requested here
  629 |   mutable _FillType __fill_;
      |                     ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:40:59: note: in instantiation of template class 'std::basic_ios<unsigned char>' requested here
   40 | class _LIBCPP_TEMPLATE_VIS basic_ostream : virtual public basic_ios<_CharT, _Traits> {
      |                                                           ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:986:57: note: in instantiation of template class 'std::basic_ostream<unsigned char>' requested here
  986 | class _LIBCPP_TEMPLATE_VIS basic_ostringstream : public basic_ostream<_CharT, _Traits> {
      |                                                         ^
/build/source/tests/src/unit-bson.cpp:624:52: note: in instantiation of template class 'std::basic_ostringstream<unsigned char>' requested here
  624 |             std::basic_ostringstream<std::uint8_t> ss;
      |                                                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:24:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:548:34: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  548 |   _LIBCPP_HIDE_FROM_ABI typename _Traits::int_type __get() const { return __fill_val_; }
      |                                  ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:24:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:551:12: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  551 |   typename _Traits::int_type __fill_val_;
      |            ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:45:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
   45 |   typedef typename traits_type::int_type int_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:986:57: note: in instantiation of template class 'std::basic_ostream<unsigned char>' requested here
  986 | class _LIBCPP_TEMPLATE_VIS basic_ostringstream : public basic_ostream<_CharT, _Traits> {
      |                                                         ^
/build/source/tests/src/unit-bson.cpp:624:52: note: in instantiation of template class 'std::basic_ostringstream<unsigned char>' requested here
  624 |             std::basic_ostringstream<std::uint8_t> ss;
      |                                                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:46:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
   46 |   typedef typename traits_type::pos_type pos_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:47:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
   47 |   typedef typename traits_type::off_type off_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:53:20: error: only virtual member functions can be marked 'override'
   53 |   ~basic_ostream() override;
      |                    ^
In file included from /build/source/tests/src/unit-bson.cpp:16:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:990:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  990 |   typedef typename traits_type::int_type int_type;
      |                    ^
/build/source/tests/src/unit-bson.cpp:624:52: note: in instantiation of template class 'std::basic_ostringstream<unsigned char>' requested here
  624 |             std::basic_ostringstream<std::uint8_t> ss;
      |                                                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:16:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:991:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  991 |   typedef typename traits_type::pos_type pos_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:16:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:992:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  992 |   typedef typename traits_type::off_type off_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:25:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/locale:215:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/streambuf:136:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  136 |   typedef typename traits_type::int_type int_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:337:53: note: in instantiation of template class 'std::basic_streambuf<unsigned char>' requested here
  337 | class _LIBCPP_TEMPLATE_VIS basic_stringbuf : public basic_streambuf<_CharT, _Traits> {
      |                                                     ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:998:59: note: in instantiation of template class 'std::basic_stringbuf<unsigned char>' requested here
  998 |   basic_stringbuf<char_type, traits_type, allocator_type> __sb_;
      |                                                           ^
/build/source/tests/src/unit-bson.cpp:624:52: note: in instantiation of template class 'std::basic_ostringstream<unsigned char>' requested here
  624 |             std::basic_ostringstream<std::uint8_t> ss;
      |                                                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:25:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/locale:215:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/streambuf:137:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  137 |   typedef typename traits_type::pos_type pos_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | [ 15%] Building CXX object tests/CMakeFiles/test-class_const_iterator_cpp11.dir/src/unit-class_const_iterator.cpp.o
struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:25:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/locale:215:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/streambuf:138:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  138 |   typedef typename traits_type::off_type off_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:25:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/locale:215:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/streambuf:140:42: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  140 |   static_assert(is_same<_CharT, typename traits_type::char_type>::value,
      |                                          ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-bson.cpp:16:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:341:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  341 |   typedef typename traits_type::int_type int_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:998:59: note: in instantiation of template class 'std::basic_stringbuf<unsigned char>' requested here
  998 |   basic_stringbuf<char_type, traits_type, allocator_type> __sb_;
      |                                                           ^
/build/source/tests/src/unit-bson.cpp:624:52: note: in instantiation of template class 'std::basic_ostringstream<unsigned char>' requested here
  624 |             std::basic_ostringstream<std::uint8_t> ss;
      |                                                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [tests/CMakeFiles/test-bson_cpp11.dir/build.make:76: tests/CMakeFiles/test-bson_cpp11.dir/src/unit-bson.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1399: tests/CMakeFiles/test-bson_cpp11.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 15%] Linking CXX executable abi_config_custom
[ 15%] Built target abi_config_custom
[ 15%] Linking CXX executable test-assert_macro_cpp11
[ 15%] Built target test-assert_macro_cpp11
In file included from /build/source/tests/src/unit-cbor.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:24:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:561:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  561 |   typedef typename traits_type::int_type int_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:40:59: note: in instantiation of template class 'std::basic_ios<unsigned char>' requested here
   40 | class _LIBCPP_TEMPLATE_VIS basic_ostream : virtual public basic_ios<_CharT, _Traits> {
      |                                                           ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:986:57: note: in instantiation of template class 'std::basic_ostream<unsigned char>' requested here
  986 | class _LIBCPP_TEMPLATE_VIS basic_ostringstream : public basic_ostream<_CharT, _Traits> {
      |                                                         ^
/build/source/tests/src/unit-cbor.cpp:1884:56: note: in instantiation of template class 'std::basic_ostringstream<unsigned char>' requested here
 1884 |                 std::basic_ostringstream<std::uint8_t> ss;
      |                                                        ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:24:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:562:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  562 |   typedef typename traits_type::pos_type pos_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:24:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:563:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  563 |   typedef typename traits_type::off_type off_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:24:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:565:42: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  565 |   static_assert(is_same<_CharT, typename traits_type::char_type>::value,
      |                                          ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:24:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:543:64: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  543 |   _LIBCPP_HIDE_FROM_ABI _SentinelValueFill& operator=(typename _Traits::int_type __x) {
      |                                                                ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:629:21: note: in instantiation of template class 'std::_SentinelValueFill<std::char_traits<unsigned char>>' requested here
  629 |   mutable _FillType __fill_;
      |                     ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:40:59: note: in instantiation of template class 'std::basic_ios<unsigned char>' requested here
   40 | class _LIBCPP_TEMPLATE_VIS basic_ostream : virtual public basic_ios<_CharT, _Traits> {
      |                                                           ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:986:57: note: in instantiation of template class 'std::basic_ostream<unsigned char>' requested here
  986 | class _LIBCPP_TEMPLATE_VIS basic_ostringstream : public basic_ostream<_CharT, _Traits> {
      |                                                         ^
/build/source/tests/src/unit-cbor.cpp:1884:56: note: in instantiation of template class 'std::basic_ostringstream<unsigned char>' requested here
 1884 |                 std::basic_ostringstream<std::uint8_t> ss;
      |                                                        ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:24:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:548:34: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  548 |   _LIBCPP_HIDE_FROM_ABI typename _Traits::int_type __get() const { return __fill_val_; }
      |                                  ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:24:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ios:551:12: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  551 |   typename _Traits::int_type __fill_val_;
      |            ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:45:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
   45 |   typedef typename traits_type::int_type int_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:986:57: note: in instantiation of template class 'std::basic_ostream<unsigned char>' requested here
  986 | class _LIBCPP_TEMPLATE_VIS basic_ostringstream : public basic_ostream<_CharT, _Traits> {
      |                                                         ^
/build/source/tests/src/unit-cbor.cpp:1884:56: note: in instantiation of template class 'std::basic_ostringstream<unsigned char>' requested here
 1884 |                 std::basic_ostringstream<std::uint8_t> ss;
      |                                                        ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:46:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
   46 |   typedef typename traits_type::pos_type pos_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:47:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
   47 |   typedef typename traits_type::off_type off_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:53:20: error: only virtual member functions can be marked 'override'
   53 |   ~basic_ostream() override;
      |                    ^
In file included from /build/source/tests/src/unit-cbor.cpp:15:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:990:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  990 |   typedef typename traits_type::int_type int_type;
      |                    ^
/build/source/tests/src/unit-cbor.cpp:1884:56: note: in instantiation of template class 'std::basic_ostringstream<unsigned char>' requested here
 1884 |                 std::basic_ostringstream<std::uint8_t> ss;
      |                                                        ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:15:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:991:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  991 |   typedef typename traits_type::pos_type pos_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:15:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:992:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  992 |   typedef typename traits_type::off_type off_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:25:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/locale:215:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/streambuf:136:20: error: [ 15%] Linking CXX executable test-byte_container_with_subtype_cpp11
implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  136 |   typedef typename traits_type::int_type int_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:337:53: note: in instantiation of template class 'std::basic_streambuf<unsigned char>' requested here
  337 | class _LIBCPP_TEMPLATE_VIS basic_stringbuf : public basic_streambuf<_CharT, _Traits> {
      |                                                     ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:998:59: note: in instantiation of template class 'std::basic_stringbuf<unsigned char>' requested here
  998 |   basic_stringbuf<char_type, traits_type, allocator_type> __sb_;
      |                                                           ^
/build/source/tests/src/unit-cbor.cpp:1884:56: note: in instantiation of template class 'std::basic_ostringstream<unsigned char>' requested here
 1884 |                 std::basic_ostringstream<std::uint8_t> ss;
      |                                                        ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:25:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/locale:215:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/streambuf:137:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  137 |   typedef typename traits_type::pos_type pos_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:25:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/locale:215:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/streambuf:138:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  138 |   typedef typename traits_type::off_type off_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:9:
In file included from /build/source/tests/thirdparty/doctest/doctest_compatibility.h:6:
In file included from /build/source/tests/thirdparty/doctest/doctest.h:514:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/ostream:177:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__ostream/basic_ostream.h:25:
In file included from /nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/locale:215:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/streambuf:140:42: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  140 |   static_assert(is_same<_CharT, typename traits_type::char_type>::value,
      |                                          ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
In file included from /build/source/tests/src/unit-cbor.cpp:15:
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:341:20: error: implicit instantiation of undefined template 'std::char_traits<unsigned char>'
  341 |   typedef typename traits_type::int_type int_type;
      |                    ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/sstream:998:59: note: in instantiation of template class 'std::basic_stringbuf<unsigned char>' requested here
  998 |   basic_stringbuf<char_type, traits_type, allocator_type> __sb_;
      |                                                           ^
/build/source/tests/src/unit-cbor.cpp:1884:56: note: in instantiation of template class 'std::basic_ostringstream<unsigned char>' requested here
 1884 |                 std::basic_ostringstream<std::uint8_t> ss;
      |                                                        ^
/nix/store/rfmv7mz9bn2l6r7gy4cvpqawjws1d6jl-libcxx-19.1.1-dev/include/c++/v1/__fwd/string.h:23:29: note: template is declared here
   23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
      |                             ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make[2]: *** [tests/CMakeFiles/test-cbor_cpp11.dir/build.make:76: tests/CMakeFiles/test-cbor_cpp11.dir/src/unit-cbor.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1477: tests/CMakeFiles/test-cbor_cpp11.dir/all] Error 2
[ 15%] Built target test-byte_container_with_subtype_cpp11
[ 15%] Linking CXX executable abi_config_default
[ 15%] Built target abi_config_default
[ 16%] Linking CXX executable abi_config_noversion
[ 16%] Built target abi_config_noversion
[ 17%] Linking CXX executable abi_compat_inline_ns
[ 17%] Built target abi_compat_inline_ns
[ 17%] Linking CXX executable test-capacity_cpp11
[ 17%] Built target test-capacity_cpp11
[ 18%] Linking CXX executable test-allocator_cpp11
[ 18%] Built target test-allocator_cpp11
[ 19%] Linking CXX executable test-class_const_iterator_cpp11
[ 19%] Built target test-class_const_iterator_cpp11
[ 20%] Linking CXX executable test-binary_formats_cpp11
[ 20%] Built target test-binary_formats_cpp11
[ 20%] Linking CXX executable test-alt-string_cpp11
[ 20%] Built target test-alt-string_cpp11
[ 21%] Linking CXX executable test-algorithms_cpp11
[ 21%] Built target test-algorithms_cpp11
[ 22%] Linking CXX executable test-bjdata_cpp11
[ 22%] Built target test-bjdata_cpp11
make: *** [Makefile:146: all] Error 2

Compiler and operating system

clang-19 w/ libc++ on ubuntu using nix-shell

Library version

3.1.0 and the HEAD of develop

Validation

@paparodeo paparodeo changed the title tests fail to build with clang-19 and libc++ tests fail to build with clang-19 and libc++ due to unsupported std::char_traits Nov 10, 2024
@paparodeo
Copy link
Author

this diff will make the tests compile for clang-19 by removing unsupported types.

diff --git a/tests/src/unit-bson.cpp b/tests/src/unit-bson.cpp
index 13216f2..fdfc350 100644
--- a/tests/src/unit-bson.cpp
+++ b/tests/src/unit-bson.cpp
@@ -621,7 +621,7 @@ TEST_CASE("BSON input/output_adapters")
     {
         SECTION("std::ostringstream")
         {
-            std::basic_ostringstream<std::uint8_t> ss;
+            std::basic_ostringstream<char> ss;
             json::to_bson(json_representation, ss);
             json j3 = json::from_bson(ss.str());
             CHECK(json_representation == j3);
diff --git a/tests/src/unit-cbor.cpp b/tests/src/unit-cbor.cpp
index be94d2f..2b396b7 100644
--- a/tests/src/unit-cbor.cpp
+++ b/tests/src/unit-cbor.cpp
@@ -1881,7 +1881,7 @@ TEST_CASE("single CBOR roundtrip")
         {
             SECTION("std::ostringstream")
             {
-                std::basic_ostringstream<std::uint8_t> ss;
+                std::basic_ostringstream<char> ss;
                 json::to_cbor(j1, ss);
                 json j3 = json::from_cbor(ss.str());
                 CHECK(j1 == j3);
diff --git a/tests/src/unit-deserialization.cpp b/tests/src/unit-deserialization.cpp
index 3bc161f..e4918b0 100644
--- a/tests/src/unit-deserialization.cpp
+++ b/tests/src/unit-deserialization.cpp
@@ -1131,13 +1131,11 @@ TEST_CASE("deserialization")
     }
 }
 
+
 TEST_CASE_TEMPLATE("deserialization of different character types (ASCII)", T,
-                   char, unsigned char, signed char,
+                   char,
                    wchar_t,
-                   char16_t, char32_t,
-                   std::uint8_t, std::int8_t,
-                   std::int16_t, std::uint16_t,
-                   std::int32_t, std::uint32_t)
+                   char16_t, char32_t)
 {
     std::vector<T> const v = {'t', 'r', 'u', 'e'};
     CHECK(json::parse(v) == json(true));
@@ -1163,7 +1161,7 @@ TEST_CASE_TEMPLATE("deserialization of different character types (UTF-8)", T,
 }
 
 TEST_CASE_TEMPLATE("deserialization of different character types (UTF-16)", T,
-                   char16_t, std::uint16_t)
+                   char16_t)
 {
     // a star emoji
     std::vector<T> const v = {static_cast<T>('"'), static_cast<T>(0x2b50), static_cast<T>(0xfe0f), static_cast<T>('"')};
@@ -1176,7 +1174,7 @@ TEST_CASE_TEMPLATE("deserialization of different character types (UTF-16)", T,
 }
 
 TEST_CASE_TEMPLATE("deserialization of different character types (UTF-32)", T,
-                   char32_t, std::uint32_t)
+                   char32_t)
 {
     // a star emoji
     std::vector<T> const v = {static_cast<T>('"'), static_cast<T>(0x2b50), static_cast<T>(0xfe0f), static_cast<T>('"')};
diff --git a/tests/src/unit-msgpack.cpp b/tests/src/unit-msgpack.cpp
index 61162af..cfbb1fa 100644
--- a/tests/src/unit-msgpack.cpp
+++ b/tests/src/unit-msgpack.cpp
@@ -1604,7 +1604,7 @@ TEST_CASE("single MessagePack roundtrip")
         {
             SECTION("std::ostringstream")
             {
-                std::basic_ostringstream<std::uint8_t> ss;
+                std::basic_ostringstream<char> ss;
                 json::to_msgpack(j1, ss);
                 json j3 = json::from_msgpack(ss.str());
                 CHECK(j1 == j3);
diff --git a/tests/src/unit-regression2.cpp b/tests/src/unit-regression2.cpp
index fab9aae..98947c5 100644
--- a/tests/src/unit-regression2.cpp
+++ b/tests/src/unit-regression2.cpp
@@ -674,6 +674,7 @@ TEST_CASE("regression tests 2")
         CHECK(j.dump() == "{}");
     }
 
+#if 0
 #ifdef JSON_HAS_CPP_20
 #if __has_include(<span>)
     SECTION("issue #2546 - parsing containers of std::byte")
@@ -684,6 +685,7 @@ TEST_CASE("regression tests 2")
         CHECK(j.dump() == "\"Hello, world!\"");
     }
 #endif
+#endif
 #endif
 
     SECTION("issue #2574 - Deserialization to std::array, std::pair, and std::tuple with non-default constructable types fails")

@nlohmann
Copy link
Owner

Thanks for reporting. We really need a CI runner for clang+libc++ to detect this ourselves...

@nlohmann
Copy link
Owner

With #4495, I can reproduce the issue.

nlohmann added a commit that referenced this issue Nov 16, 2024
nlohmann added a commit that referenced this issue Nov 16, 2024
@nlohmann nlohmann linked a pull request Nov 16, 2024 that will close this issue
@nlohmann nlohmann added the solution: proposed fix a fix for the issue has been proposed and waits for confirmation label Nov 16, 2024
nlohmann added a commit that referenced this issue Nov 17, 2024
* 👷 add test for libstdc++

* 👷 add test for libstdc++

* 💚 add fixes from #4490

* 💚 add fixes from #4490
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
confirmed kind: bug 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.

2 participants