From c6ab9061919bc875199dd0c779f1d71f78f2e274 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 13 Jan 2017 12:18:42 +0000 Subject: [PATCH] PR78361 recognise noexcept functions as referenceable 2017-01-13 Jonathan Wakely PR libstdc++/78361 * testsuite/20_util/add_pointer/value.cc: Test forming function pointers. 2017-01-13 Michael Brune PR libstdc++/78361 * include/std/type_traits (__is_referenceable): Handle noexcept function types. From-SVN: r244432 --- libstdc++-v3/ChangeLog | 12 ++++++++++++ libstdc++-v3/include/std/type_traits | 8 ++++---- .../testsuite/20_util/add_pointer/value.cc | 15 +++++++++++++++ 3 files changed, 31 insertions(+), 4 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8bf7d07b9e9..3421ed102ea 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,15 @@ +2017-01-13 Jonathan Wakely + + PR libstdc++/78361 + * testsuite/20_util/add_pointer/value.cc: Test forming function + pointers. + +2017-01-13 Michael Brune + + PR libstdc++/78361 + * include/std/type_traits (__is_referenceable): Handle noexcept + function types. + 2017-01-12 Jonathan Wakely PR libstdc++/77528 diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index d0fa390ceac..a50f06ca46a 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -641,13 +641,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : public __or_, is_reference<_Tp>>::type { }; - template - struct __is_referenceable<_Res(_Args...)> + template + struct __is_referenceable<_Res(_Args...) _GLIBCXX_NOEXCEPT_QUAL> : public true_type { }; - template - struct __is_referenceable<_Res(_Args......)> + template + struct __is_referenceable<_Res(_Args......) _GLIBCXX_NOEXCEPT_QUAL> : public true_type { }; diff --git a/libstdc++-v3/testsuite/20_util/add_pointer/value.cc b/libstdc++-v3/testsuite/20_util/add_pointer/value.cc index e0688cbc4ce..a2f1e671366 100644 --- a/libstdc++-v3/testsuite/20_util/add_pointer/value.cc +++ b/libstdc++-v3/testsuite/20_util/add_pointer/value.cc @@ -34,3 +34,18 @@ void test01() ClassType**>::value, ""); static_assert(is_same::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::type, pf1_type>::value, ""); + void f2() noexcept; // PR libstdc++/78361 + using f2_type = decltype(f2); + using pf2_type = decltype(&f2); + static_assert(is_same::type, pf2_type>::value, ""); +} -- 2.30.2