Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update comments for approved LWG issues #3238

Merged
merged 1 commit into from
Nov 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions stl/inc/atomic
Original file line number Diff line number Diff line change
Expand Up @@ -2626,46 +2626,44 @@ _Ty atomic_fetch_xor_explicit(

#if _HAS_CXX20
_EXPORT_STD template <class _Ty>
void atomic_wait(const volatile atomic<_Ty>* const _Mem, const typename atomic<_Ty>::value_type _Expected) noexcept
/* strengthened */ {
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved
void atomic_wait(const volatile atomic<_Ty>* const _Mem, const typename atomic<_Ty>::value_type _Expected) noexcept {
_Mem->wait(_Expected);
}

_EXPORT_STD template <class _Ty>
void atomic_wait(const atomic<_Ty>* const _Mem, const typename atomic<_Ty>::value_type _Expected) noexcept
/* strengthened */ {
void atomic_wait(const atomic<_Ty>* const _Mem, const typename atomic<_Ty>::value_type _Expected) noexcept {
_Mem->wait(_Expected);
}

_EXPORT_STD template <class _Ty>
void atomic_wait_explicit(const volatile atomic<_Ty>* const _Mem, const typename atomic<_Ty>::value_type _Expected,
const memory_order _Order) noexcept /* strengthened */ {
const memory_order _Order) noexcept {
_Mem->wait(_Expected, _Order);
}

_EXPORT_STD template <class _Ty>
void atomic_wait_explicit(const atomic<_Ty>* const _Mem, const typename atomic<_Ty>::value_type _Expected,
const memory_order _Order) noexcept /* strengthened */ {
const memory_order _Order) noexcept {
_Mem->wait(_Expected, _Order);
}

_EXPORT_STD template <class _Ty>
void atomic_notify_one(volatile atomic<_Ty>* const _Mem) noexcept /* strengthened */ {
void atomic_notify_one(volatile atomic<_Ty>* const _Mem) noexcept {
_Mem->notify_one();
}

_EXPORT_STD template <class _Ty>
void atomic_notify_one(atomic<_Ty>* const _Mem) noexcept /* strengthened */ {
void atomic_notify_one(atomic<_Ty>* const _Mem) noexcept {
_Mem->notify_one();
}

_EXPORT_STD template <class _Ty>
void atomic_notify_all(volatile atomic<_Ty>* const _Mem) noexcept /* strengthened */ {
void atomic_notify_all(volatile atomic<_Ty>* const _Mem) noexcept {
_Mem->notify_all();
}

_EXPORT_STD template <class _Ty>
void atomic_notify_all(atomic<_Ty>* const _Mem) noexcept /* strengthened */ {
void atomic_notify_all(atomic<_Ty>* const _Mem) noexcept {
_Mem->notify_all();
}
#endif // _HAS_CXX20
Expand Down
6 changes: 4 additions & 2 deletions stl/inc/ranges
Original file line number Diff line number Diff line change
Expand Up @@ -3328,7 +3328,9 @@ namespace ranges {
static constexpr bool _Deref_is_glvalue = is_reference_v<_InnerRng<_Const>>;

/* [[no_unique_address]] */ _OuterIter _Outer{};
/* [[no_unique_address]] */ _Defaultabox<_InnerIter> _Inner{}; // per LWG-3569
/* [[no_unique_address]] */ _Defaultabox<_InnerIter> _Inner{}; // Non-standard extension: when _Inner_iter
// is default-constructible, we don't wrap in
// an optional-like.
_Parent_t* _Parent{};

constexpr auto&& _Update_inner() {
Expand Down Expand Up @@ -3383,7 +3385,7 @@ namespace ranges {
using difference_type = common_type_t<range_difference_t<_Base>, range_difference_t<_InnerRng<_Const>>>;

// clang-format off
_Iterator() requires default_initializable<_OuterIter> = default; // per LWG-3569
_Iterator() requires default_initializable<_OuterIter> = default;
// clang-format on

constexpr _Iterator(_Parent_t& _Parent_, _OuterIter _Outer_)
Expand Down
1 change: 0 additions & 1 deletion stl/inc/thread
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ public:
jthread& operator=(const jthread&) = delete;

jthread& operator=(jthread&& _Other) noexcept {
// Per LWG-3788
if (this == _STD addressof(_Other)) {
return *this;
}
Expand Down
4 changes: 2 additions & 2 deletions stl/inc/type_traits
Original file line number Diff line number Diff line change
Expand Up @@ -1894,8 +1894,8 @@ private:
public:
template <class... _Types>
_CONSTEXPR20 auto operator()(_Types&&... _Args) const
noexcept(noexcept(_STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...))) // strengthened
-> decltype(_STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...)) {
noexcept(noexcept(_STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...)))
-> decltype(_STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...)) {
return _STD invoke(*_Ptr, static_cast<_Types&&>(_Args)...);
}
};
Expand Down
16 changes: 8 additions & 8 deletions stl/inc/xutility
Original file line number Diff line number Diff line change
Expand Up @@ -3319,10 +3319,10 @@ namespace ranges {
#ifdef __clang__ // TRANSITION, LLVM-44833
template <class _Dx = _Derived>
_NODISCARD constexpr auto cbegin()
requires input_range<_Dx> // Per LWG-3766
requires input_range<_Dx>
#else // ^^^ workaround / no workaround vvv
_NODISCARD constexpr auto cbegin()
requires input_range<_Derived> // Per LWG-3766
requires input_range<_Derived>
#endif // TRANSITION, LLVM-44833
{
return _RANGES cbegin(_Cast());
Expand All @@ -3331,10 +3331,10 @@ namespace ranges {
#ifdef __clang__ // TRANSITION, LLVM-44833
template <class _Dx = _Derived>
_NODISCARD constexpr auto cbegin() const
requires input_range<const _Dx> // Per LWG-3766
requires input_range<const _Dx>
#else // ^^^ workaround / no workaround vvv
_NODISCARD constexpr auto cbegin() const
requires input_range<const _Derived> // Per LWG-3766
requires input_range<const _Derived>
#endif // TRANSITION, LLVM-44833
{
return _RANGES cbegin(_Cast());
Expand All @@ -3343,10 +3343,10 @@ namespace ranges {
#ifdef __clang__ // TRANSITION, LLVM-44833
template <class _Dx = _Derived>
_NODISCARD constexpr auto cend()
requires input_range<_Dx> // Per LWG-3766
requires input_range<_Dx>
#else // ^^^ workaround / no workaround vvv
_NODISCARD constexpr auto cend()
requires input_range<_Derived> // Per LWG-3766
requires input_range<_Derived>
#endif // TRANSITION, LLVM-44833
{
return _RANGES cend(_Cast());
Expand All @@ -3355,10 +3355,10 @@ namespace ranges {
#ifdef __clang__ // TRANSITION, LLVM-44833
template <class _Dx = _Derived>
_NODISCARD constexpr auto cend() const
requires input_range<const _Dx> // Per LWG-3766
requires input_range<const _Dx>
#else // ^^^ workaround / no workaround vvv
_NODISCARD constexpr auto cend() const
requires input_range<const _Derived> // Per LWG-3766
requires input_range<const _Derived>
#endif // TRANSITION, LLVM-44833
{
return _RANGES cend(_Cast());
Expand Down
2 changes: 1 addition & 1 deletion tests/std/tests/P0660R10_jthread_and_cv_any/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ int main() {
assert(!worker_b.joinable());
}

{ // self move assign, as of LWG-3788 defined to not do anything
{ // self move assign, defined to have no effects
jthread worker{[] {}};
auto old_id = worker.get_id();
assert(old_id != jthread::id{});
Expand Down