Skip to content

Commit 9168f16

Browse files
committed
As DR
1 parent 92358bf commit 9168f16

File tree

3 files changed

+9
-35
lines changed

3 files changed

+9
-35
lines changed

libcxx/include/istream

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,13 +294,11 @@ public:
294294
basic_istream& getline(char_type* __s, streamsize __n, char_type __dlm);
295295

296296
basic_istream& ignore(streamsize __n = 1, int_type __dlm = traits_type::eof());
297-
# if _LIBCPP_STD_VER >= 26
298-
_LIBCPP_HIDE_FROM_ABI basic_istream& ignore(streamsize __n, char_type __delim)
299-
requires is_same_v<char_type, char>
300-
{
301-
return this->ignore(__n, _Traits::to_int_type(__delim));
297+
template <class _Tp = char_type>
298+
inline _LIBCPP_HIDE_FROM_ABI_AFTER_V1 typename std::enable_if<is_same<_Tp, char>::value, basic_istream&>::type
299+
ignore(streamsize __n, char_type __delim) {
300+
return ignore(__n, traits_type::to_int_type(__delim));
302301
}
303-
# endif
304302
int_type peek();
305303
basic_istream& read(char_type* __s, streamsize __n);
306304
streamsize readsome(char_type* __s, streamsize __n);

libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore.char_type.pass.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
// REQUIRES: std-at-least-c++26
10-
119
// Requires 396145d in the built library.
1210
// XFAIL: using-built-library-before-llvm-9
1311

@@ -33,5 +31,10 @@ int main(int, char**) {
3331
in >> str;
3432
assert(str == "Clown");
3533

34+
// Parameter value "-1L" doesn't cause ambiguity with the char_type overload.
35+
in.ignore(100, -1L); // ignore up to EOF, which is the default behavior
36+
assert(in.eof()); // stream should be at EOF now
37+
// assert(in.gcount() == 5);
38+
3639
return 0;
3740
}

libcxx/test/std/input.output/iostream.format/input.streams/istream.unformatted/ignore.verify.cpp

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)