diff mbox series

Add missing noexpect causes in tuple for move functions

Message ID 20181130230529.1499-1-xerofoify@gmail.com
State New
Headers show
Series Add missing noexpect causes in tuple for move functions | expand

Commit Message

Nicholas Krause Nov. 30, 2018, 11:05 p.m. UTC
This adds the remainging noexcept causes required for this cause
to meet the spec as dicussed last year and documented here:
http://cplusplus.github.io/LWG/lwg-active.html#2899.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
 libstdc++-v3/include/std/tuple | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Ville Voutilainen Nov. 30, 2018, 11:12 p.m. UTC | #1
On Sat, 1 Dec 2018 at 01:05, Nicholas Krause <xerofoify@gmail.com> wrote:
>
> This adds the remainging noexcept causes required for this cause
> to meet the spec as dicussed last year and documented here:
> http://cplusplus.github.io/LWG/lwg-active.html#2899.

I don't see how this change is sufficient; the noexcept-specs need to
be added to tuple's
special member functions, not just to _Tuple_impl, and your suggested
patch contains no
tests.
Nicholas Krause Dec. 1, 2018, 1:03 a.m. UTC | #2
On 2018-11-30 6:12 p.m., Ville Voutilainen wrote:
> On Sat, 1 Dec 2018 at 01:05, Nicholas Krause <xerofoify@gmail.com> wrote:
>>
>> This adds the remainging noexcept causes required for this cause
>> to meet the spec as dicussed last year and documented here:
>> http://cplusplus.github.io/LWG/lwg-active.html#2899.
> 
> I don't see how this change is sufficient; the noexcept-specs need to
> be added to tuple's
> special member functions, not just to _Tuple_impl, and your suggested
> patch contains no
> tests.
> 

It was tested I just didn't mention that as it was assumed, that's my mistake and
sorry for that. This was more just to make sure that this is fine. If you would
prefer I send a patch  cleaning it up for all the classes i.e. tuple, and it's 
version's that's fine. I just want to ask do you want a patch or a series will
each patch touching one of the tuple clases as I assume your the maintainer.

Cheers,

Nick
diff mbox series

Patch

diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple
index 56b97c25eed..d17512a1b7e 100644
--- a/libstdc++-v3/include/std/tuple
+++ b/libstdc++-v3/include/std/tuple
@@ -214,6 +214,8 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
                enable_if<sizeof...(_Tail) == sizeof...(_UTail)>::type>
         explicit
         constexpr _Tuple_impl(_UHead&& __head, _UTail&&... __tail)
+        noexcept(__and_<is_nothrow_move_constructible<_Head>,
+	              is_nothrow_move_constructible<_Inherited>>::value)
 	: _Inherited(std::forward<_UTail>(__tail)...),
 	  _Base(std::forward<_UHead>(__head)) { }
 
@@ -237,6 +239,8 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       template<typename _UHead, typename... _UTails>
         constexpr _Tuple_impl(_Tuple_impl<_Idx, _UHead, _UTails...>&& __in)
+        noexcept(__and_<is_nothrow_move_constructible<_Head>,
+	              is_nothrow_move_constructible<_Inherited>>::value)
 	: _Inherited(std::move
 		     (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))),
 	  _Base(std::forward<_UHead>