diff mbox

PR libstdc++/80493 fix invalid exception specification

Message ID 20170424113859.GA8084@redhat.com
State New
Headers show

Commit Message

Jonathan Wakely April 24, 2017, 11:38 a.m. UTC
This was fixed for std::optional, but not the TS version, so Clang
rejects it.

	PR libstdc++/80493
	* include/experimental/optional (optional::swap): Fix exception
	specification.

Tested powerpc64le-linux, committed to trunk.
commit 1d7d6db208e6371f00f8aecd77eb1a78a6fbe578
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Apr 24 12:15:13 2017 +0100

    PR libstdc++/80493 fix invalid exception specification
    
    	PR libstdc++/80493
    	* include/experimental/optional (optional::swap): Fix exception
    	specification.
diff mbox

Patch

diff --git a/libstdc++-v3/include/experimental/optional b/libstdc++-v3/include/experimental/optional
index 197a1fc..4a1e71d 100644
--- a/libstdc++-v3/include/experimental/optional
+++ b/libstdc++-v3/include/experimental/optional
@@ -690,7 +690,7 @@  _GLIBCXX_BEGIN_NAMESPACE_VERSION
       void
       swap(optional& __other)
       noexcept(is_nothrow_move_constructible<_Tp>()
-               && noexcept(swap(declval<_Tp&>(), declval<_Tp&>())))
+               && __is_nothrow_swappable<_Tp>::value)
       {
         using std::swap;