This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Implement P1147R1 (Printing volatile T*)
ClosedPublic

Authored by ldionne on Nov 9 2021, 5:36 AM.

Details

Summary

Implement P1147R1

Diff Detail

Event Timeline

philnik requested review of this revision.Nov 9 2021, 5:36 AM
philnik created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptNov 9 2021, 5:36 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne requested changes to this revision.Nov 9 2021, 7:15 AM
ldionne added a subscriber: ldionne.

Thanks for the patch! Can you please go through the list at https://libcxx.llvm.org/Contributing.html and make sure you didn't forget anything?

This revision now requires changes to proceed.Nov 9 2021, 7:15 AM
philnik updated this revision to Diff 385808.Nov 9 2021, 7:20 AM

Added synopsis and updated status

ldionne requested changes to this revision.Nov 9 2021, 7:25 AM

LGTM except for the testing nitpick. Requesting changes so it shows up at the top once you update.

libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.pass.cpp
62

Sorry for missing that in the first round of review, but the new tests should live in a new file like pointer.volatile.pass.cpp, and should show the correct synopsis for what we're testing. You can then mark it as // UNSUPPORTED: c++03, c++11, c++17, c++20.

This revision now requires changes to proceed.Nov 9 2021, 7:25 AM
philnik updated this revision to Diff 385820.Nov 9 2021, 7:46 AM
philnik marked an inline comment as done.

Moved tests into new file

I don't have commit permissions, so someone else has to commit it for me. "Nikolas Klauser" <nikolasklauser@berlin.de>

ldionne accepted this revision.Nov 9 2021, 8:40 AM

Thanks for the patch!

This revision is now accepted and ready to land.Nov 9 2021, 8:40 AM
ldionne added inline comments.Nov 9 2021, 8:52 AM
libcxx/include/ostream
58

Nitpick: add // C++23.

I'll do this when committing on your behalf.

libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.volatile.pass.cpp
16 ↗(On Diff #385820)

Nit: this is missing a return type. I'll fix that upon committing.

Quuxplusone accepted this revision.Nov 9 2021, 9:18 AM
Quuxplusone added a subscriber: Quuxplusone.

LGTM as well.

libcxx/include/ostream
58

// since C++23 :)

215–217

These lines are misindented; should be 4 spaces.
Also consider s/__val/__p/g for consistency with line 213, but whatever.
Also consider linebreaking after _LIBCPP_HIDE_FROM_ABI.

libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.volatile.pass.cpp
64 ↗(On Diff #385820)

Style nit: Lines 51, 57, 64: IIUC, sb.str() returns something of type std::string already, so the cast-like direct-initialization syntax is unnecessary. std::string s3 = sb3.str(); would be fine.

ldionne commandeered this revision.Nov 9 2021, 10:15 AM
ldionne edited reviewers, added: philnik; removed: ldionne.

Commandeering to update.

libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters.arithmetic/pointer.volatile.pass.cpp
11 ↗(On Diff #385820)

This is also missing c++14 from the list.

ldionne updated this revision to Diff 385876.Nov 9 2021, 10:16 AM
ldionne marked 3 inline comments as done.

Update nits.

Quuxplusone accepted this revision.Nov 9 2021, 12:09 PM
This revision was automatically updated to reflect the committed changes.