1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template<Returnable R, class T, CopyConstructible... Args>
13 // unspecified mem_fn(R (T::* pm)(Args...) const volatile);
20 char test0() const volatile {return 'a';}
21 char test1(int) const volatile {return 'b';}
22 char test2(int, double) const volatile {return 'c';}
34 const volatile A* cap = &a;
35 assert(f(cap) == 'a');
37 assert(cf(ap) == 'a');
47 assert(f(a, 1) == 'b');
49 assert(f(ap, 2) == 'b');
50 const volatile A* cap = &a;
51 assert(f(cap, 2) == 'b');
53 assert(cf(ap, 2) == 'b');
63 assert(f(a, 1, 2) == 'c');
65 assert(f(ap, 2, 3.5) == 'c');
66 const volatile A* cap = &a;
67 assert(f(cap, 2, 3.5) == 'c');
69 assert(cf(ap, 2, 3.5) == 'c');
75 test0(std::mem_fn(&A::test0));
76 test1(std::mem_fn(&A::test1));
77 test2(std::mem_fn(&A::test2));