llvm-project/libcxx/test/std/input.output/iostream.format
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
..
ext.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
input.streams Add markup for libc++ dylib availability 2017-05-04 17:08:54 +00:00
output.streams Ensure showbase does not overflow do_put buffers 2017-05-06 20:58:50 +00:00
quoted.manip [libcxx] [test] Fix comment typos, strip trailing whitespace. 2017-01-18 20:10:25 +00:00
std.manip Move remaining _LIBCPP_VERSION tests into test/libcxx 2016-06-22 02:23:22 +00:00
nothing_to_do.pass.cpp