PR libstdc++/83427 detect weak result type from noexcept functions
commit00677c48777bca36afe6fcddd380d004959998a3
authorJonathan Wakely <jwakely@redhat.com>
Thu, 14 Dec 2017 17:18:22 +0000 (14 17:18 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 14 Dec 2017 17:18:22 +0000 (14 17:18 +0000)
tree92c8339eeda08ec4c2912c57f9aeb729e4d729e7
parentdb811328e004b0d97d25187dc985184c260955ee
PR libstdc++/83427 detect weak result type from noexcept functions

PR libstdc++/83427
* include/bits/refwrap.h (_Maybe_unary_or_binary_function): Move here
from <bits/std_function.h>.
(_Mem_fn_traits_base, _Mem_fn_traits): Move here, from <functional>.
(_Weak_result_type_impl, _Reference_wrapper_base): Deduce noexcept
for function types. Remove partial specializations for member
functions.
(_Weak_result_type_impl): Remove unused partial specializations for
non-referenceable function types and for references to functions.
(_Weak_result_type_memfun, _Reference_wrapper_base_memfun): New
helpers to handle member functions via _Mem_fn_traits.
(_Weak_result_type, reference_wrapper): Derive from new helpers.
* include/bits/std_function.h (_Maybe_unary_or_binary_function): Move
to <bits/refwrap.h>.
* include/std/functional (_Pack, _AllConvertible, _NotSame): Remove.
(_Mem_fn_traits_base, _Mem_fn_traits): Move to <bits/refwrap.h>.
* testsuite/20_util/bind/83427.cc: New test.
* testsuite/20_util/bind/refqual.cc: Add noexcept to functions and
check for weak result types.
* testsuite/20_util/reference_wrapper/83427.cc: New test.

From-SVN: r255651
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/refwrap.h
libstdc++-v3/include/bits/std_function.h
libstdc++-v3/include/std/functional
libstdc++-v3/testsuite/20_util/bind/83427.cc [copied from libstdc++-v3/testsuite/20_util/bind/refqual.cc with 63% similarity]
libstdc++-v3/testsuite/20_util/bind/refqual.cc
libstdc++-v3/testsuite/20_util/reference_wrapper/83427.cc [new file with mode: 0644]