Skip to content

<syncstream>: is_nothrow_move_assignable_v<osyncstream> is squirrelly 🐿️ #3355

Description

WG21-N4928 [syncstream.osyncstream.overview] depicts basic_osyncstream& operator=(basic_osyncstream&&) noexcept;. However, it also depicts an exposition-only data member syncbuf_type sb; and [syncstream.syncbuf.assign] depicts basic_syncbuf& operator=(basic_syncbuf&& rhs); which is not noexcept (it calls emit()).

Our current implementation:

basic_osyncstream& operator=(basic_osyncstream&&) noexcept = default;

STL/stl/inc/syncstream

Lines 371 to 372 in fbed7ea

private:
syncbuf_type _Sync_buf;

STL/stl/inc/syncstream

Lines 109 to 110 in fbed7ea

basic_syncbuf& operator=(basic_syncbuf&& _Right) {
emit();

It seems to me that there's an LWG issue here, and that operator=(basic_osyncstream&&) should not be marked noexcept in the Standard (and in our implementation).

Programmer-archaeology: LWG-3498 "Inconsistent noexcept-specifiers for basic_syncbuf" (already merged into the WP) removed noexcept from operator=(basic_syncbuf&&) because it calls emit(). It seems to me that operator=(basic_osyncstream&&) was simply missed at that time.

Noticed while reviewing #3314.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    LWG issue neededA wording defect that should be submitted to LWG as a new issuefixedSomething works now, yay!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions