This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Move fpos into its own header
ClosedPublic

Authored by philnik on Feb 3 2022, 8:38 AM.

Details

Summary

For some reason <string> defines std::fpos, which should be defined in <ios>.

Diff Detail

Event Timeline

philnik created this revision.Feb 3 2022, 8:38 AM
philnik requested review of this revision.Feb 3 2022, 8:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 3 2022, 8:38 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript

The test test/std/input.output/iostreams.base/fpos/fpos.operations/fpos.pass.cpp also needs to be updated

  • Update the includes
  • Update the synopsis
libcxx/include/__ios/fpos.h
30

Would be nice to use _LIBCPP_HIDE_FROM_ABI here.

57

Please remove one blank line.

philnik updated this revision to Diff 405681.Feb 3 2022, 9:21 AM
philnik marked 2 inline comments as done.
  • Address comments
Mordante accepted this revision as: Mordante.Feb 3 2022, 9:23 AM

LGTM if the CI passes.

Quuxplusone accepted this revision.Feb 3 2022, 10:03 AM
Quuxplusone added inline comments.
libcxx/include/__ios/fpos.h
1

Since you're _LIBCPP_HIDE_FROM_ABI'ing this code already, do you also want to 2-space-indent it?

17

D118800 is related. Please use the prevailing style until/unless we agree to do something different:

$ git grep '#pragma GCC system_header' ../libcxx/include/ | wc -l
     484
$ git grep '# pragma GCC system_header' ../libcxx/include/ | wc -l
       1
$ git grep '#  pragma GCC system_header' ../libcxx/include/ | wc -l
      16
$ git grep '#   pragma GCC system_header' ../libcxx/include/ | wc -l
       2
$ git grep '#    pragma GCC system_header' ../libcxx/include/ | wc -l
       0
This revision is now accepted and ready to land.Feb 3 2022, 10:03 AM
philnik updated this revision to Diff 405825.Feb 3 2022, 4:08 PM
philnik marked an inline comment as done.

@Quuxplusone are you OK with it just being clang-formatted? I know you and I disagree what is readable, but I think in this case there is nothing you would object to.

libcxx/include/__ios/fpos.h
17

I'll go with 2 spaces here, since that seems to be what you do in D118800.

Quuxplusone accepted this revision.Feb 3 2022, 7:03 PM

Two nits, then ship it!

libcxx/include/__ios/fpos.h
71

Let's linebreak after _LIBCPP_HIDE_FROM_ABI and before bool, in each case.

77
philnik updated this revision to Diff 405917.Feb 4 2022, 4:06 AM
philnik marked 2 inline comments as done.
  • Address nits, generate files
Quuxplusone accepted this revision.Feb 4 2022, 8:06 AM
This revision was automatically updated to reflect the committed changes.