mirror of git://gcc.gnu.org/git/gcc.git
Use correct value category in std::function constraint
* include/std/functional (function::_Callable): Use lvalue in result_of expression. * testsuite/20_util/function/cons/refqual.cc: New test. From-SVN: r239208
This commit is contained in:
parent
3d06e8eb93
commit
23441d2f60
|
|
@ -1,5 +1,12 @@
|
||||||
2016-08-06 Jonathan Wakely <jwakely@redhat.com>
|
2016-08-06 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
|
Backport from mainline
|
||||||
|
2016-08-05 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
|
* include/std/functional (function::_Callable): Use lvalue in
|
||||||
|
result_of expression.
|
||||||
|
* testsuite/20_util/function/cons/refqual.cc: New test.
|
||||||
|
|
||||||
Backport from mainline
|
Backport from mainline
|
||||||
2016-07-22 Jonathan Wakely <jwakely@redhat.com>
|
2016-07-22 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1978,7 +1978,7 @@ _GLIBCXX_MEM_FN_TRAITS(&&, false_type, true_type)
|
||||||
typedef _Res _Signature_type(_ArgTypes...);
|
typedef _Res _Signature_type(_ArgTypes...);
|
||||||
|
|
||||||
template<typename _Func,
|
template<typename _Func,
|
||||||
typename _Res2 = typename result_of<_Func(_ArgTypes...)>::type>
|
typename _Res2 = typename result_of<_Func&(_ArgTypes...)>::type>
|
||||||
struct _Callable : __check_func_return_type<_Res2, _Res> { };
|
struct _Callable : __check_func_return_type<_Res2, _Res> { };
|
||||||
|
|
||||||
// Used so the return type convertibility checks aren't done when
|
// Used so the return type convertibility checks aren't done when
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,31 @@
|
||||||
|
// Copyright (C) 2016 Free Software Foundation, Inc.
|
||||||
|
//
|
||||||
|
// This file is part of the GNU ISO C++ Library. This library is free
|
||||||
|
// software; you can redistribute it and/or modify it under the
|
||||||
|
// terms of the GNU General Public License as published by the
|
||||||
|
// Free Software Foundation; either version 3, or (at your option)
|
||||||
|
// any later version.
|
||||||
|
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU General Public License for more details.
|
||||||
|
|
||||||
|
// You should have received a copy of the GNU General Public License along
|
||||||
|
// with this library; see the file COPYING3. If not see
|
||||||
|
// <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
// { dg-options "-std=gnu++11" }
|
||||||
|
|
||||||
|
#include <functional>
|
||||||
|
|
||||||
|
struct F {
|
||||||
|
void operator()() && { }
|
||||||
|
int operator()() & { return 0; }
|
||||||
|
};
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
F f;
|
||||||
|
std::function<int()> ff{f};
|
||||||
|
return ff();
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue