1*3c8e31e1SArthur O'Dwyer //===----------------------------------------------------------------------===//
2*3c8e31e1SArthur O'Dwyer //
3*3c8e31e1SArthur O'Dwyer // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*3c8e31e1SArthur O'Dwyer // See https://llvm.org/LICENSE.txt for license information.
5*3c8e31e1SArthur O'Dwyer // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*3c8e31e1SArthur O'Dwyer //
7*3c8e31e1SArthur O'Dwyer //===----------------------------------------------------------------------===//
8*3c8e31e1SArthur O'Dwyer
9*3c8e31e1SArthur O'Dwyer // <functional>
10*3c8e31e1SArthur O'Dwyer
11*3c8e31e1SArthur O'Dwyer #include <functional>
12*3c8e31e1SArthur O'Dwyer
13*3c8e31e1SArthur O'Dwyer #include "test_macros.h"
14*3c8e31e1SArthur O'Dwyer
15*3c8e31e1SArthur O'Dwyer struct Incomplete;
16*3c8e31e1SArthur O'Dwyer template<class T> struct Holder { T t; };
17*3c8e31e1SArthur O'Dwyer typedef Holder<Incomplete> *Ptr;
18*3c8e31e1SArthur O'Dwyer
no_args()19*3c8e31e1SArthur O'Dwyer Ptr no_args() { return nullptr; }
one_arg(Ptr p)20*3c8e31e1SArthur O'Dwyer Ptr one_arg(Ptr p) { return p; }
two_args(Ptr p,Ptr)21*3c8e31e1SArthur O'Dwyer Ptr two_args(Ptr p, Ptr) { return p; }
three_args(Ptr p,Ptr,Ptr)22*3c8e31e1SArthur O'Dwyer Ptr three_args(Ptr p, Ptr, Ptr) { return p; }
23*3c8e31e1SArthur O'Dwyer
one_arg_void(Ptr)24*3c8e31e1SArthur O'Dwyer void one_arg_void(Ptr) { }
25*3c8e31e1SArthur O'Dwyer
main(int,char **)26*3c8e31e1SArthur O'Dwyer int main(int, char**)
27*3c8e31e1SArthur O'Dwyer {
28*3c8e31e1SArthur O'Dwyer Ptr x = nullptr;
29*3c8e31e1SArthur O'Dwyer const Ptr cx = nullptr;
30*3c8e31e1SArthur O'Dwyer std::ref(no_args)();
31*3c8e31e1SArthur O'Dwyer std::ref(one_arg)(x);
32*3c8e31e1SArthur O'Dwyer std::ref(one_arg)(cx);
33*3c8e31e1SArthur O'Dwyer std::ref(two_args)(x, x);
34*3c8e31e1SArthur O'Dwyer std::ref(two_args)(x, cx);
35*3c8e31e1SArthur O'Dwyer std::ref(two_args)(cx, x);
36*3c8e31e1SArthur O'Dwyer std::ref(two_args)(cx, cx);
37*3c8e31e1SArthur O'Dwyer std::ref(three_args)(x, x, x);
38*3c8e31e1SArthur O'Dwyer std::ref(three_args)(x, x, cx);
39*3c8e31e1SArthur O'Dwyer std::ref(three_args)(x, cx, x);
40*3c8e31e1SArthur O'Dwyer std::ref(three_args)(cx, x, x);
41*3c8e31e1SArthur O'Dwyer std::ref(three_args)(x, cx, cx);
42*3c8e31e1SArthur O'Dwyer std::ref(three_args)(cx, x, cx);
43*3c8e31e1SArthur O'Dwyer std::ref(three_args)(cx, cx, x);
44*3c8e31e1SArthur O'Dwyer std::ref(three_args)(cx, cx, cx);
45*3c8e31e1SArthur O'Dwyer std::ref(one_arg_void)(x);
46*3c8e31e1SArthur O'Dwyer std::ref(one_arg_void)(cx);
47*3c8e31e1SArthur O'Dwyer
48*3c8e31e1SArthur O'Dwyer return 0;
49*3c8e31e1SArthur O'Dwyer }
50