1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
13 #include "test_macros.h"
16 template<class T
> struct Holder
{ T t
; };
17 typedef Holder
<Incomplete
> *Ptr
;
20 Ptr
no_args() const { return nullptr; }
21 Ptr
one_arg(Ptr p
) const { return p
; }
22 void one_arg_void(Ptr
) const { }
31 const Ptr cx
= nullptr;
32 std::mem_fn(&A::no_args
)(a
);
33 std::mem_fn(&A::no_args
)(pa
);
34 std::mem_fn(&A::no_args
)(*cpa
);
35 std::mem_fn(&A::no_args
)(cpa
);
36 std::mem_fn(&A::one_arg
)(a
, x
);
37 std::mem_fn(&A::one_arg
)(pa
, x
);
38 std::mem_fn(&A::one_arg
)(a
, cx
);
39 std::mem_fn(&A::one_arg
)(pa
, cx
);
40 std::mem_fn(&A::one_arg
)(*cpa
, x
);
41 std::mem_fn(&A::one_arg
)(cpa
, x
);
42 std::mem_fn(&A::one_arg
)(*cpa
, cx
);
43 std::mem_fn(&A::one_arg
)(cpa
, cx
);
44 std::mem_fn(&A::one_arg_void
)(a
, x
);
45 std::mem_fn(&A::one_arg_void
)(pa
, x
);
46 std::mem_fn(&A::one_arg_void
)(a
, cx
);
47 std::mem_fn(&A::one_arg_void
)(pa
, cx
);
48 std::mem_fn(&A::one_arg_void
)(*cpa
, x
);
49 std::mem_fn(&A::one_arg_void
)(cpa
, x
);
50 std::mem_fn(&A::one_arg_void
)(*cpa
, cx
);
51 std::mem_fn(&A::one_arg_void
)(cpa
, cx
);