llvm-project/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted
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.formatted.reqmts
ostream.inserters [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.inserters.arithmetic Ensure showbase does not overflow do_put buffers 2017-05-06 20:58:50 +00:00
ostream.inserters.character [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
nothing_to_do.pass.cpp