]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libstdc++-v3/testsuite/20_util/bind/68912.cc
a32b44be0ade31c629b898032de98d297c277a81
1 // Copyright (C) 2015-2016 Free Software Foundation, Inc.
3 // This file is part of the GNU ISO C++ Library. This library is free
4 // software; you can redistribute it and/or modify it under the
5 // terms of the GNU General Public License as published by the
6 // Free Software Foundation; either version 3, or (at your option)
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License along
15 // with this library; see the file COPYING3. If not see
16 // <http://www.gnu.org/licenses/>.
18 // { dg-do compile { target c++11 } }
29 A
operator()(int, double) & { return {}; }
30 Wrong
operator()(int, double) && {return {}; }
32 B
operator()(int, double) const & { return {}; }
33 Wrong
operator()(int, double) const && {return {}; }
35 C
operator()(int, double) volatile & { return {}; }
36 Wrong
operator()(int, double) volatile && {return {}; }
38 D
operator()(int, double) const volatile & { return {}; }
39 Wrong
operator()(int, double) const volatile && {return {}; }
44 auto bound
= std::bind(X
{}, 5, std::placeholders::_1
);
46 const auto bound_c
= bound
;
47 B res_c
= bound_c(1.0);
48 #if __cplusplus <= 201402L
49 volatile auto bound_v
= bound
;
50 C res_v
= bound_v(1.0);
51 volatile const auto bound_cv
= bound
;
52 D res_cv
= bound_cv(1.0);