Skip to content

Commit f4ea19b

Browse files
authored
[libc++][syncbuf] Implement LWG3253 (#99778)
Closes #100264
1 parent c792de2 commit f4ea19b

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

libcxx/docs/Status/Cxx20Issues.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
"`LWG3221 <https://wg21.link/LWG3221>`__","Result of ``year_month``\ arithmetic with ``months``\ is ambiguous","2019-11 (Belfast)","|Complete|","8.0",""
173173
"`LWG3235 <https://wg21.link/LWG3235>`__","``parse``\ manipulator without abbreviation is not callable","2019-11 (Belfast)","","",""
174174
"`LWG3246 <https://wg21.link/LWG3246>`__","LWG3246: What are the constraints on the template parameter of `basic_format_arg`?","2019-11 (Belfast)","|Nothing To Do|","",""
175-
"`LWG3253 <https://wg21.link/LWG3253>`__","``basic_syncbuf::basic_syncbuf()``\ should not be explicit","2019-11 (Belfast)","","",""
175+
"`LWG3253 <https://wg21.link/LWG3253>`__","``basic_syncbuf::basic_syncbuf()``\ should not be explicit","2019-11 (Belfast)","|Complete|","20.0",""
176176
"`LWG3245 <https://wg21.link/LWG3245>`__","Unnecessary restriction on ``'%p'``\ parse specifier","2019-11 (Belfast)","","",""
177177
"`LWG3244 <https://wg21.link/LWG3244>`__","Constraints for ``Source``\ in |sect|\ [fs.path.req] insufficiently constrainty","2019-11 (Belfast)","","",""
178178
"`LWG3241 <https://wg21.link/LWG3241>`__","``chrono-spec``\ grammar ambiguity in |sect|\ [time.format]","2019-11 (Belfast)","|Complete|","16.0",""

libcxx/include/syncstream

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ namespace std {
4646
using streambuf_type = basic_streambuf<charT, traits>;
4747
4848
// [syncstream.syncbuf.cons], construction and destruction
49-
explicit basic_syncbuf(streambuf_type* obuf = nullptr)
49+
basic_syncbuf()
50+
: basic_syncbuf(nullptr) {}
51+
explicit basic_syncbuf(streambuf_type* obuf)
5052
: basic_syncbuf(obuf, Allocator()) {}
5153
basic_syncbuf(streambuf_type*, const Allocator&);
5254
basic_syncbuf(basic_syncbuf&&);
@@ -253,7 +255,10 @@ public:
253255

254256
// [syncstream.syncbuf.cons], construction and destruction
255257

256-
_LIBCPP_HIDE_FROM_ABI explicit basic_syncbuf(streambuf_type* __obuf = nullptr)
258+
_LIBCPP_HIDE_FROM_ABI basic_syncbuf()
259+
: basic_syncbuf(nullptr) {}
260+
261+
_LIBCPP_HIDE_FROM_ABI explicit basic_syncbuf(streambuf_type* __obuf)
257262
: basic_syncbuf(__obuf, _Allocator()) {}
258263

259264
_LIBCPP_HIDE_FROM_ABI basic_syncbuf(streambuf_type* __obuf, _Allocator const& __alloc)

libcxx/test/std/input.output/syncstream/syncbuf/syncstream.syncbuf.cons/cons.default.pass.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,15 @@
2525
#include "constexpr_char_traits.h"
2626
#include "test_allocator.h"
2727

28+
template <class CharT>
29+
std::basic_syncbuf<CharT> lwg3253_default_constructor_is_not_explicit() {
30+
return {};
31+
}
32+
2833
template <class CharT>
2934
void test() {
35+
lwg3253_default_constructor_is_not_explicit<CharT>();
36+
3037
{
3138
using Buf = std::basic_syncbuf<CharT>;
3239
static_assert(std::default_initializable<Buf>);

0 commit comments

Comments
 (0)