aboutsummaryrefslogtreecommitdiff
path: root/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp')
-rw-r--r--test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp
new file mode 100644
index 000000000000..1c56aa9f5dc5
--- /dev/null
+++ b/test/std/depr/depr.function.objects/depr.adaptors/depr.member.pointer.adaptors/const_mem_fun.cxx1z.fail.cpp
@@ -0,0 +1,35 @@
+//===----------------------------------------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is dual licensed under the MIT and the University of Illinois Open
+// Source Licenses. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// <functional>
+
+// template<cReturnable S, ClassType T>
+// const_mem_fun_t<S,T>
+// mem_fun(S (T::*f)() const);
+// Removed in c++1z
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+
+#include <functional>
+#include <cassert>
+
+#include "test_macros.h"
+
+struct A
+{
+ char a1() {return 5;}
+ short a2(int i) {return short(i+1);}
+ int a3() const {return 1;}
+ double a4(unsigned i) const {return i-1;}
+};
+
+int main()
+{
+ const A a = A();
+ assert(std::mem_fun(&A::a3)(&a) == 1);
+}