[libc++][syncbuf] Implement LWG3253 (#99778)

Closes #100264
This commit is contained in:
Mark de Wever
2024-08-30 16:13:47 +02:00
committed by GitHub
parent c792de28df
commit f4ea19b47e
3 changed files with 15 additions and 3 deletions

View File

@@ -172,7 +172,7 @@
"`LWG3221 <https://wg21.link/LWG3221>`__","Result of ``year_month``\ arithmetic with ``months``\ is ambiguous","2019-11 (Belfast)","|Complete|","8.0",""
"`LWG3235 <https://wg21.link/LWG3235>`__","``parse``\ manipulator without abbreviation is not callable","2019-11 (Belfast)","","",""
"`LWG3246 <https://wg21.link/LWG3246>`__","LWG3246: What are the constraints on the template parameter of `basic_format_arg`?","2019-11 (Belfast)","|Nothing To Do|","",""
"`LWG3253 <https://wg21.link/LWG3253>`__","``basic_syncbuf::basic_syncbuf()``\ should not be explicit","2019-11 (Belfast)","","",""
"`LWG3253 <https://wg21.link/LWG3253>`__","``basic_syncbuf::basic_syncbuf()``\ should not be explicit","2019-11 (Belfast)","|Complete|","20.0",""
"`LWG3245 <https://wg21.link/LWG3245>`__","Unnecessary restriction on ``'%p'``\ parse specifier","2019-11 (Belfast)","","",""
"`LWG3244 <https://wg21.link/LWG3244>`__","Constraints for ``Source``\ in |sect|\ [fs.path.req] insufficiently constrainty","2019-11 (Belfast)","","",""
"`LWG3241 <https://wg21.link/LWG3241>`__","``chrono-spec``\ grammar ambiguity in |sect|\ [time.format]","2019-11 (Belfast)","|Complete|","16.0",""
1 Issue # Issue Name Meeting Status First released version Notes
172 `LWG3221 <https://wg21.link/LWG3221>`__ Result of ``year_month``\ arithmetic with ``months``\ is ambiguous 2019-11 (Belfast) |Complete| 8.0
173 `LWG3235 <https://wg21.link/LWG3235>`__ ``parse``\ manipulator without abbreviation is not callable 2019-11 (Belfast)
174 `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) |Complete| 20.0
176 `LWG3245 <https://wg21.link/LWG3245>`__ Unnecessary restriction on ``'%p'``\ parse specifier 2019-11 (Belfast)
177 `LWG3244 <https://wg21.link/LWG3244>`__ Constraints for ``Source``\ in |sect|\ [fs.path.req] insufficiently constrainty 2019-11 (Belfast)
178 `LWG3241 <https://wg21.link/LWG3241>`__ ``chrono-spec``\ grammar ambiguity in |sect|\ [time.format] 2019-11 (Belfast) |Complete| 16.0

View File

@@ -46,7 +46,9 @@ namespace std {
using streambuf_type = basic_streambuf<charT, traits>;
// [syncstream.syncbuf.cons], construction and destruction
explicit basic_syncbuf(streambuf_type* obuf = nullptr)
basic_syncbuf()
: basic_syncbuf(nullptr) {}
explicit basic_syncbuf(streambuf_type* obuf)
: basic_syncbuf(obuf, Allocator()) {}
basic_syncbuf(streambuf_type*, const Allocator&);
basic_syncbuf(basic_syncbuf&&);
@@ -253,7 +255,10 @@ public:
// [syncstream.syncbuf.cons], construction and destruction
_LIBCPP_HIDE_FROM_ABI explicit basic_syncbuf(streambuf_type* __obuf = nullptr)
_LIBCPP_HIDE_FROM_ABI basic_syncbuf()
: basic_syncbuf(nullptr) {}
_LIBCPP_HIDE_FROM_ABI explicit basic_syncbuf(streambuf_type* __obuf)
: basic_syncbuf(__obuf, _Allocator()) {}
_LIBCPP_HIDE_FROM_ABI basic_syncbuf(streambuf_type* __obuf, _Allocator const& __alloc)

View File

@@ -25,8 +25,15 @@
#include "constexpr_char_traits.h"
#include "test_allocator.h"
template <class CharT>
std::basic_syncbuf<CharT> lwg3253_default_constructor_is_not_explicit() {
return {};
}
template <class CharT>
void test() {
lwg3253_default_constructor_is_not_explicit<CharT>();
{
using Buf = std::basic_syncbuf<CharT>;
static_assert(std::default_initializable<Buf>);