[all-commits] [llvm/llvm-project] 7cc72a: Implement syncstream (p0053)

Mark de Wever via All-commits all-commits at lists.llvm.org
Wed Nov 8 08:45:35 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7cc72a0a2ec22855572d96411febd4f2c4ac5a49
      https://github.com/llvm/llvm-project/commit/7cc72a0a2ec22855572d96411febd4f2c4ac5a49
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2023-11-08 (Wed, 08 Nov 2023)

  Changed paths:
    M libcxx/docs/FeatureTestMacroTable.rst
    M libcxx/docs/ReleaseNotes/18.rst
    M libcxx/docs/Status/Cxx20Issues.csv
    M libcxx/docs/Status/Cxx20Papers.csv
    M libcxx/docs/Status/Cxx23Issues.csv
    M libcxx/include/CMakeLists.txt
    M libcxx/include/__config
    M libcxx/include/__std_clang_module
    M libcxx/include/iosfwd
    M libcxx/include/map
    M libcxx/include/streambuf
    A libcxx/include/syncstream
    M libcxx/include/version
    M libcxx/modules/std.cppm.in
    M libcxx/modules/std/iosfwd.inc
    M libcxx/modules/std/syncstream.inc
    M libcxx/test/libcxx/experimental/fexperimental-library.compile.pass.cpp
    M libcxx/test/libcxx/transitive_includes/cxx03.csv
    M libcxx/test/libcxx/transitive_includes/cxx11.csv
    M libcxx/test/libcxx/transitive_includes/cxx14.csv
    M libcxx/test/libcxx/transitive_includes/cxx17.csv
    M libcxx/test/libcxx/transitive_includes/cxx20.csv
    M libcxx/test/libcxx/transitive_includes/cxx23.csv
    M libcxx/test/libcxx/transitive_includes/cxx26.csv
    A libcxx/test/std/input.output/syncstream/osyncstream/assign.pass.cpp
    A libcxx/test/std/input.output/syncstream/osyncstream/members/emit.pass.cpp
    A libcxx/test/std/input.output/syncstream/osyncstream/members/get_wrapped.pass.cpp
    A libcxx/test/std/input.output/syncstream/osyncstream/members/rdbuf.pass.cpp
    A libcxx/test/std/input.output/syncstream/osyncstream/syncstream.osyncstream.cons/cons.move.pass.cpp
    A libcxx/test/std/input.output/syncstream/osyncstream/syncstream.osyncstream.cons/cons.ostream.allocator.pass.cpp
    A libcxx/test/std/input.output/syncstream/osyncstream/syncstream.osyncstream.cons/cons.ostream.pass.cpp
    A libcxx/test/std/input.output/syncstream/osyncstream/syncstream.osyncstream.cons/cons.pointer.allocator.pass.cpp
    A libcxx/test/std/input.output/syncstream/osyncstream/syncstream.osyncstream.cons/cons.pointer.pass.cpp
    A libcxx/test/std/input.output/syncstream/osyncstream/thread/basic.pass.cpp
    A libcxx/test/std/input.output/syncstream/osyncstream/thread/several_threads.pass.cpp
    A libcxx/test/std/input.output/syncstream/osyncstream/types.compile.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/helpers.h
    A libcxx/test/std/input.output/syncstream/syncbuf/sputc.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/sputn.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/sync.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/syncstream.syncbuf.assign/assign.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/syncstream.syncbuf.assign/swap.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/syncstream.syncbuf.cons/cons.default.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/syncstream.syncbuf.cons/cons.move.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/syncstream.syncbuf.cons/cons.pointer.allocator.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/syncstream.syncbuf.cons/cons.pointer.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/syncstream.syncbuf.cons/dtor.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/syncstream.syncbuf.members/emit.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/syncstream.syncbuf.members/get_allocator.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/syncstream.syncbuf.members/get_wrapped.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/syncstream.syncbuf.members/set_emit_on_sync.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/syncstream.syncbuf.special/swap.pass.cpp
    A libcxx/test/std/input.output/syncstream/syncbuf/types.compile.pass.cpp
    A libcxx/test/std/language.support/support.limits/support.limits.general/syncstream.version.compile.pass.cpp
    M libcxx/test/std/language.support/support.limits/support.limits.general/version.version.compile.pass.cpp
    M libcxx/test/support/test_allocator.h
    M libcxx/utils/generate_feature_test_macro_components.py
    M libcxx/utils/libcxx/header_information.py
    M libcxx/utils/libcxx/test/params.py

  Log Message:
  -----------
  Implement syncstream (p0053)

This patch implements `std::basic_syncbuf` and `std::basic_osyncstream` as specified in paper p0053r7. ~~For ease of reviewing I am submitting this patch before submitting a patch for `std::basic_osyncstream`. ~~

~~Please note, this patch is not 100% complete. I plan on adding more tests (see comments), specifically I plan on adding tests for multithreading and synchronization.~~

Edit: I decided that it would be far easier for me to keep track of this and make changes that affect both `std::basic_syncbuf` and `std::basic_osyncstream` if both were in one patch.

The patch was originally written by @zoecarver

Implements
- P0053R7 - C++ Synchronized Buffered Ostream
- LWG-3127 basic_osyncstream::rdbuf needs a const_cast
- LWG-3334 basic_osyncstream move assignment and destruction calls basic_syncbuf::emit() twice
- LWG-3570 basic_osyncstream::emit should be an unformatted output function
- LWG-3867 Should std::basic_osyncstream's move assignment operator be noexcept?

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D67086




More information about the All-commits mailing list