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

Fix compilation of iconv tests with libcxx 19 #182

Open
wants to merge 1 commit into
base: feature
Choose a base branch
from

Conversation

al3xtjames
Copy link

libcxx 18 deprecated the std::basic_string template specializations for int16_t and int32_t, which are currently used by the iconv tests. The template specializations were removed altogether in libcxx 19, which breaks compilation of the iconv tests. Replace int16_t and int32_t with char16_t and char32_t to fix compilation with libcxx 19.

I added the static_assert for checking the sizes of char16_t and char32_t as the standard allows them to contain padding bytes.

Fixes #181.

[libcxx 18 deprecated the `std::basic_string` template specializations
for `int16_t` and `int32_t`][1], which are currently used by the iconv
tests. [The template specializations were removed altogether in libcxx
19][2], which breaks compilation of the iconv tests. Replace `int16_t`
and `int32_t` with `char16_t` and `char32_t` to fix compilation with
libcxx 19.

I added the `static_assert` for checking the sizes of `char16_t` and
`char32_t` as [the standard allows them to contain padding bytes][3].

[1]: https://reviews.llvm.org/D138307
[2]: https://reviews.llvm.org/D157058
[3]: https://en.cppreference.com/w/cpp/language/types#char16_t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tests/tests/iconv.cpp no longer compiles with libcxx 19
1 participant