-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Labels
confirmed
kind: bug
solution: proposed fix
a fix for the issue has been proposed and waits for confirmation
Comments
13 tasks
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 Nov 10, 2024
std::char_traits
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") |
Thanks for reporting. We really need a CI runner for clang+libc++ to detect this ourselves... |
Merged
With #4495, I can reproduce the issue. |
Merged
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
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
Description
when using clang-19 with
libc++
the build fails to build the testshttps://releases.llvm.org/19.1.0/projects/libcxx/docs/ReleaseNotes.html
Reproduction steps
Expected vs. actual results
expect build to succeed like it does when using an earlier clang / libc++ combination.
Minimal code example
failing tests are:
Error messages
Compiler and operating system
clang-19 w/ libc++ on ubuntu using nix-shell
Library version
3.1.0 and the HEAD of develop
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: