[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libcxx / test / std / utilities / function.objects / func.memfn / robust_against_adl.pass.cpp
blob2bb8e9f49209a8a9b56920256d39026d236dacb9
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 //===----------------------------------------------------------------------===//
9 // <functional>
11 #include <functional>
13 #include "test_macros.h"
15 struct Incomplete;
16 template<class T> struct Holder { T t; };
17 typedef Holder<Incomplete> *Ptr;
19 struct A {
20 Ptr no_args() const { return nullptr; }
21 Ptr one_arg(Ptr p) const { return p; }
22 void one_arg_void(Ptr) const { }
25 int main(int, char**)
27 A a;
28 A *pa = &a;
29 const A *cpa = &a;
30 Ptr x = nullptr;
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);
52 return 0;