1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9// UNSUPPORTED: c++03
10
11// <functional>
12
13// class function<R(ArgTypes...)>
14
15// R operator()(ArgTypes... args) const
16
17#include <functional>
18#include <cassert>
19
20// member data pointer: cv qualifiers should transfer from argument to return type
21
22struct Foo { int data; };
23
24void f() {
25 int Foo::*fp = &Foo::data;
26 std::function<int& (const Foo*)> r2(fp); // expected-error {{no matching constructor for initialization of}}
27}
28

source code of libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.verify.cpp