1 // { dg-options "-std=gnu++0x" }
4 // Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING3. If not see
19 // <http://www.gnu.org/licenses/>.
29 int cmember2(char)const;
32 struct functor1 : public std::unary_function<int, double>
34 double operator()(int) const;
37 struct functor2 : public std::binary_function<int, char, double>
39 double operator()(int, char) const;
43 void verify_return_type(T, T)
51 std::reference_wrapper<double (int)>* pr1(0);
52 verify_return_type((*pr1)(0), double());
53 std::reference_wrapper<double (*)(int)>* pr2(0);
54 verify_return_type((*pr2)(0), double());
55 std::reference_wrapper<functor1>* pr5(0);
58 verify_return_type((*pr5)(0), double());
59 verify_return_type((*pr5)(zero), double());
61 std::reference_wrapper<double (int, char)>* pr1b(0);
62 verify_return_type((*pr1b)(0, 0), double());
63 std::reference_wrapper<double (*)(int, char)>* pr2b(0);
64 verify_return_type((*pr2b)(0, 0), double());
65 std::reference_wrapper<functor2>* pr5b(0);
68 verify_return_type((*pr5b)(0, 0), double());
69 verify_return_type((*pr5b)(zero, zero), double());