Skip to content
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
aa7ce10
[libc++][istream] P3223R2 Making `std::istream::ignore` less surprising
H-G-Hristov Jul 4, 2025
7c6aac2
Some fixes
H-G-Hristov Jul 4, 2025
b9b6b2d
Cleanup
H-G-Hristov Jul 4, 2025
64d894b
Cleanup
H-G-Hristov Jul 4, 2025
9286094
Update libcxx/include/istream
Zingam Jul 5, 2025
31fa136
Update libcxx/include/istream
Zingam Jul 5, 2025
6aac62a
Try one last time
H-G-Hristov Jul 6, 2025
7de8061
Updated status
H-G-Hristov Jul 13, 2025
92358bf
Update libcxx/docs/Status/Cxx2cPapers.csv
Zingam Jul 14, 2025
9168f16
As DR
H-G-Hristov Jul 14, 2025
ee72bb4
Update libcxx/test/std/input.output/iostream.format/input.streams/ist…
Zingam Jul 15, 2025
4c807e1
Fix formatting
H-G-Hristov Jul 15, 2025
cb2254f
Use more typical syntax
H-G-Hristov Jul 15, 2025
cf357b0
Cleanup
H-G-Hristov Jul 15, 2025
186eaa7
LLVM22
H-G-Hristov Jul 22, 2025
60a4b5b
LLVM22
H-G-Hristov Jul 22, 2025
7eb7d12
Update libcxx/include/istream
H-G-Hristov Jul 29, 2025
846aea6
Update libcxx/test/std/input.output/iostream.format/input.streams/ist…
H-G-Hristov Jul 29, 2025
22060b7
Update libcxx/include/istream
H-G-Hristov Aug 1, 2025
6d9c59c
Update libcxx/include/istream
H-G-Hristov Aug 1, 2025
0f553f8
Merge branch 'main' into hgh/libcxx/P3223R2-Making-std_istream_ignore…
H-G-Hristov Aug 11, 2025
4e515df
Merge branch 'main' into hgh/libcxx/P3223R2-Making-std_istream_ignore…
Zingam Aug 16, 2025
3eea9a4
Merge branch 'main' into hgh/libcxx/P3223R2-Making-std_istream_ignore…
H-G-Hristov Aug 19, 2025
74bf0bc
Merge branch 'main' into hgh/libcxx/P3223R2-Making-std_istream_ignore…
H-G-Hristov Aug 19, 2025
9fc4932
Merge branch 'main' into hgh/libcxx/P3223R2-Making-std_istream_ignore…
H-G-Hristov Aug 20, 2025
5130970
Merge branch 'main' into hgh/libcxx/P3223R2-Making-std_istream_ignore…
H-G-Hristov Aug 25, 2025
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
1 change: 1 addition & 0 deletions libcxx/docs/ReleaseNotes/22.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Implemented Papers
------------------

- P2321R2: ``zip`` (`Github <https://github.com/llvm/llvm-project/issues/105169>`__) (The paper is partially implemented. ``zip_transform_view`` is implemented in this release)
- P3223R2: Making ``std::istream::ignore`` less surprising (`Github <https://github.com/llvm/llvm-project/issues/148178>`__)

Improvements and New Features
-----------------------------
Expand Down
2 changes: 1 addition & 1 deletion libcxx/docs/Status/Cxx2cPapers.csv
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"`P3111R8 <https://wg21.link/P3111R8>`__","Atomic Reduction Operations","2025-06 (Sofia)","","",""
"`P3060R3 <https://wg21.link/P3060R3>`__","Add ``std::views::indices(n)``","2025-06 (Sofia)","","",""
"`P2319R5 <https://wg21.link/P2319R5>`__","Prevent ``path`` presentation problems","2025-06 (Sofia)","","",""
"`P3223R2 <https://wg21.link/P3223R2>`__","Making ``std::istream::ignore`` less surprising","2025-06 (Sofia)","","",""
"`P3223R2 <https://wg21.link/P3223R2>`__","Making ``std::istream::ignore`` less surprising","2025-06 (Sofia)","|Complete|","22",""
"`P2781R9 <https://wg21.link/P2781R9>`__","``std::constant_wrapper``","2025-06 (Sofia)","","",""
"`P3697R1 <https://wg21.link/P3697R1>`__","Minor additions to C++26 standard library hardening","2025-06 (Sofia)","","",""
"`P3552R3 <https://wg21.link/P3552R3>`__","Add a Coroutine Task Type","2025-06 (Sofia)","","",""
Expand Down
6 changes: 6 additions & 0 deletions libcxx/include/istream
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ public:
basic_istream& getline(char_type* s, streamsize n, char_type delim);

basic_istream& ignore(streamsize n = 1, int_type delim = traits_type::eof());
basic_istream& ignore(streamsize n, char_type delim); // Since C++26
int_type peek();
basic_istream& read (char_type* s, streamsize n);
streamsize readsome(char_type* s, streamsize n);
Expand Down Expand Up @@ -172,6 +173,7 @@ template <class Stream, class T>
# include <__type_traits/conjunction.h>
# include <__type_traits/enable_if.h>
# include <__type_traits/is_base_of.h>
# include <__type_traits/is_same.h>
# include <__type_traits/make_unsigned.h>
# include <__utility/declval.h>
# include <__utility/forward.h>
Expand Down Expand Up @@ -292,6 +294,10 @@ public:
basic_istream& getline(char_type* __s, streamsize __n, char_type __dlm);

basic_istream& ignore(streamsize __n = 1, int_type __dlm = traits_type::eof());
template <class _Tp = char_type, __enable_if_t<is_same<_Tp, char>::value, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 basic_istream& ignore(streamsize __n, char_type __delim) {
return ignore(__n, traits_type::to_int_type(__delim));
}
int_type peek();
basic_istream& read(char_type* __s, streamsize __n);
streamsize readsome(char_type* __s, streamsize __n);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

// Requires 396145d in the built library.
// XFAIL: using-built-library-before-llvm-9
// XFAIL: FROZEN-CXX03-HEADERS-FIXME

// <istream>

// basic_istream& ignore(streamsize n, char_type delim);

#include <cassert>
#include <sstream>
#include <string>

#include "test_macros.h"

int main(int, char**) {
std::istringstream in("\xF0\x9F\xA4\xA1 Clown Face");
in.ignore(100, '\xA1'); // Ignore up to '\xA1' delimiter,
// previously might have ignored to EOF.

assert(in.gcount() == 4); // 4 bytes were ignored.
assert(in.peek() == ' '); // Next character is a space.

std::string str; // Read the next word.
in >> str;
assert(str == "Clown");

// Parameter value "-1L" doesn't cause ambiguity with the char_type overload.
in.ignore(100, -1L); // Ignore up to EOF, which is the default behavior.
assert(in.eof()); // Stream should be at EOF now.
assert(in.gcount() == 5);

return 0;
}
Loading