Commit c6ab9061 by Jonathan Wakely

PR78361 recognise noexcept functions as referenceable

2017-01-13  Jonathan Wakely  <jwakely@redhat.com>

	PR libstdc++/78361
	* testsuite/20_util/add_pointer/value.cc: Test forming function
	pointers.

2017-01-13  Michael Brune  <lucdanton@free.fr>

	PR libstdc++/78361
	* include/std/type_traits (__is_referenceable): Handle noexcept
	function types.

From-SVN: r244432
parent b3686dde
2017-01-13 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/78361
* testsuite/20_util/add_pointer/value.cc: Test forming function
pointers.
2017-01-13 Michael Brune <lucdanton@free.fr>
PR libstdc++/78361
* include/std/type_traits (__is_referenceable): Handle noexcept
function types.
2017-01-12 Jonathan Wakely <jwakely@redhat.com> 2017-01-12 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/77528 PR libstdc++/77528
......
...@@ -641,13 +641,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION ...@@ -641,13 +641,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
: public __or_<is_object<_Tp>, is_reference<_Tp>>::type : public __or_<is_object<_Tp>, is_reference<_Tp>>::type
{ }; { };
template<typename _Res, typename... _Args> template<typename _Res, typename... _Args _GLIBCXX_NOEXCEPT_PARM>
struct __is_referenceable<_Res(_Args...)> struct __is_referenceable<_Res(_Args...) _GLIBCXX_NOEXCEPT_QUAL>
: public true_type : public true_type
{ }; { };
template<typename _Res, typename... _Args> template<typename _Res, typename... _Args _GLIBCXX_NOEXCEPT_PARM>
struct __is_referenceable<_Res(_Args......)> struct __is_referenceable<_Res(_Args......) _GLIBCXX_NOEXCEPT_QUAL>
: public true_type : public true_type
{ }; { };
......
...@@ -34,3 +34,18 @@ void test01() ...@@ -34,3 +34,18 @@ void test01()
ClassType**>::value, ""); ClassType**>::value, "");
static_assert(is_same<add_pointer<ClassType>::type, ClassType*>::value, ""); static_assert(is_same<add_pointer<ClassType>::type, ClassType*>::value, "");
} }
void test02()
{
using std::add_pointer;
using std::is_same;
void f1();
using f1_type = decltype(f1);
using pf1_type = decltype(&f1);
static_assert(is_same<add_pointer<f1_type>::type, pf1_type>::value, "");
void f2() noexcept; // PR libstdc++/78361
using f2_type = decltype(f2);
using pf2_type = decltype(&f2);
static_assert(is_same<add_pointer<f2_type>::type, pf2_type>::value, "");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment