Skip to content

[libc++] tests with picolibc: Fix iterator diff_type to std::streamoff #74072

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

Merged
merged 3 commits into from
Dec 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
// This test uses iterator types from std::filesystem
// XFAIL: availability-filesystem-missing

// std::same_as<typename Traits::difference_type, DiffType> failed.
// The former was long and the latter was long long.
// Possibly related to "using streamoff = long int" in ios.h.
// XFAIL: LIBCXX-PICOLIBC-FIXME

// template<class T>
// struct iterator_traits;

Expand Down Expand Up @@ -152,8 +147,13 @@ static_assert(testIOIterator<std::insert_iterator<std::vector<int>>, std::output
static_assert(testConst<std::istream_iterator<int, char>, std::input_iterator_tag, int>());

#if !defined(TEST_HAS_NO_LOCALIZATION)
// libc++-specific since pointer type is unspecified:
LIBCPP_STATIC_ASSERT(test<std::istreambuf_iterator<char>, std::input_iterator_tag, char, long long, char, char*>());
// We use std::istreambuf_iterator<char>::pointer because it's unspecified, it doesn't have to be char*
static_assert(test<std::istreambuf_iterator<char>,
std::input_iterator_tag,
char,
std::streamoff,
char,
std::istreambuf_iterator<char>::pointer>());
static_assert(test<std::move_iterator<int*>, std::random_access_iterator_tag, int, std::ptrdiff_t, int&&, int*>());
static_assert(testIOIterator<std::ostream_iterator<int, char>, std::output_iterator_tag>());
static_assert(testIOIterator<std::ostreambuf_iterator<int, char>, std::output_iterator_tag>());
Expand Down