KEMBAR78
[libc++] `vprint_[non]unicode(ostream &, string_view, Args&&...)` should not pad the output · Issue #116054 · llvm/llvm-project · GitHub
Skip to content

[libc++] vprint_[non]unicode(ostream &, string_view, Args&&...) should not pad the output #116054

@muellerj2

Description

@muellerj2

The current implementation of vprint_[non]unicode pads the output based on the stream's width setting:

if (std::__pad_and_output(
_Ip(__os),
__str,
(__os.flags() & ios_base::adjustfield) == ios_base::left ? __str + __len : __str,
__str + __len,
__os,
__os.fill())
.failed())

[ostream.formatted.reqmts]/3 specifies how padding is to be determined by a formatted output function if the function is specified to determine padding. Thus, the specifications of individual formatted output functions must state explicitly that "padding is to be determined" if output is to be padded. However, vprint_[non]unicode are not specified to "determine padding" in [ostream.formatted.print], so no padding should be applied.

Also note that MSVC STL and libstdc++ do not apply padding.

Metadata

Metadata

Assignees

Labels

libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions