llvm-project/libcxx/test/std/input.output/iostream.format/output.streams
Dimitry Andric 52844c83d0 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

llvm-svn: 302362
2017-05-06 20:58:50 +00:00
..
ostream
ostream.assign Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the input.output library 2017-04-18 23:38:41 +00:00
ostream.cons Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the input.output library 2017-04-18 23:38:41 +00:00
ostream.formatted Ensure showbase does not overflow do_put buffers 2017-05-06 20:58:50 +00:00
ostream.manip [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 1/7. 2016-12-08 21:37:47 +00:00
ostream.rvalue Cleanup _LIBCPP_HAS_NO_<c++11-feature> in the input.output library 2017-04-18 23:38:41 +00:00
ostream.seeks Update all bug URL's to point to https://bugs.llvm.org/... 2017-02-17 08:37:03 +00:00
ostream.unformatted [libcxx] [test] Fix MSVC warning C4244 "conversion from 'X' to 'Y', possible loss of data", part 1/7. 2016-12-08 21:37:47 +00:00
ostream_sentry Protect std::ostream::sentry test under libcpp-no-exceptions 2016-12-01 17:31:38 +00:00