You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libcxx/test/std/input.output/iostream.format/output.streams
Dimitry Andric 2f214595bc Ensure showbase does not overflow do_put buffers
Summary:
In https://bugs.freebsd.org/207918, Daniel McRobb describes how using
std::showbase with ostreams can cause truncation of unsigned long long
when output format is octal.  In fact, this can even happen with
unsigned int and unsigned long.

To ensure this does not happen, add one additional character to the
do_put buffers if std::showbase is on.  Also add a test case.

Reviewers: EricWF, mclow.lists

Reviewed By: EricWF

Subscribers: cfe-commits, emaste

Differential Revision: https://reviews.llvm.org/D32670

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@302362 91177308-0d34-0410-b5e6-96231b3b80d8
9 years ago
..
ostream Move test into test/std subdirectory. 11 years ago
ostream.assign Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the input.output library 9 years ago
ostream.cons Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the input.output library 9 years ago
ostream.formatted Ensure showbase does not overflow do_put buffers 9 years ago
ostream.manip [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 1/7. 9 years ago
ostream.rvalue Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the input.output library 9 years ago
ostream.seeks Update all bug URL's to point to https://bugs.llvm.org/... 9 years ago
ostream.unformatted [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 1/7. 9 years ago
ostream_sentry Protect std::ostream::sentry test under libcpp-no-exceptions 9 years ago