-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!
Description
basic_stringbuf implements move construction and move assignment with swap():
Lines 74 to 88 in 0403d19
| basic_stringbuf(basic_stringbuf&& _Right) : _Mystate(0) { | |
| _Assign_rv(_STD move(_Right)); | |
| } | |
| basic_stringbuf& operator=(basic_stringbuf&& _Right) noexcept /* strengthened */ { | |
| _Assign_rv(_STD move(_Right)); | |
| return *this; | |
| } | |
| void _Assign_rv(basic_stringbuf&& _Right) noexcept { | |
| if (this != _STD addressof(_Right)) { | |
| _Tidy(); | |
| this->swap(_Right); | |
| } | |
| } |
This is bogus because swap() activates POCS logic (propagate_on_container_swap), but move assignment needs to activate POCMA logic (propagate_on_container_move_assignment). The unconditional noexcept strengthening is also bogus.
Found by std/input.output/string.streams/stringbuf/stringbuf.cons/move.alloc.pass.cpp in the upcoming libcxx update that I'm working on. The error was sstream(94) : Assertion failed: The allocators of basic_stringbuf should propagate or be equal on swap.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!