Const qualify __mem_fn call operator
QOI improvement.
Differential Revision: http://llvm-reviews.chandlerc.com/D2059
llvm-svn: 199848
diff --git a/libcxx/test/utilities/function.objects/func.memfn/member_data.pass.cpp b/libcxx/test/utilities/function.objects/func.memfn/member_data.pass.cpp
index 048fca4..dff211c 100644
--- a/libcxx/test/utilities/function.objects/func.memfn/member_data.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.memfn/member_data.pass.cpp
@@ -32,6 +32,8 @@
assert(a.data_ == 6);
const A* cap = ap;
assert(f(cap) == f(ap));
+ const F& cf = f;
+ assert(cf(ap) == f(ap));
}
}
diff --git a/libcxx/test/utilities/function.objects/func.memfn/member_function.pass.cpp b/libcxx/test/utilities/function.objects/func.memfn/member_function.pass.cpp
index 01a5f8e..4096bd8 100644
--- a/libcxx/test/utilities/function.objects/func.memfn/member_function.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.memfn/member_function.pass.cpp
@@ -31,6 +31,8 @@
assert(f(a) == 'a');
A* ap = &a;
assert(f(ap) == 'a');
+ const F& cf = f;
+ assert(cf(ap) == 'a');
}
}
@@ -43,6 +45,8 @@
assert(f(a, 1) == 'b');
A* ap = &a;
assert(f(ap, 2) == 'b');
+ const F& cf = f;
+ assert(cf(ap, 2) == 'b');
}
}
@@ -55,6 +59,8 @@
assert(f(a, 1, 2) == 'c');
A* ap = &a;
assert(f(ap, 2, 3.5) == 'c');
+ const F& cf = f;
+ assert(cf(ap, 2, 3.5) == 'c');
}
}
diff --git a/libcxx/test/utilities/function.objects/func.memfn/member_function_const.pass.cpp b/libcxx/test/utilities/function.objects/func.memfn/member_function_const.pass.cpp
index 978f9f0..be22443 100644
--- a/libcxx/test/utilities/function.objects/func.memfn/member_function_const.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.memfn/member_function_const.pass.cpp
@@ -33,6 +33,8 @@
assert(f(ap) == 'a');
const A* cap = &a;
assert(f(cap) == 'a');
+ const F& cf = f;
+ assert(cf(ap) == 'a');
}
}
@@ -47,6 +49,8 @@
assert(f(ap, 2) == 'b');
const A* cap = &a;
assert(f(cap, 2) == 'b');
+ const F& cf = f;
+ assert(cf(ap, 2) == 'b');
}
}
@@ -61,6 +65,8 @@
assert(f(ap, 2, 3.5) == 'c');
const A* cap = &a;
assert(f(cap, 2, 3.5) == 'c');
+ const F& cf = f;
+ assert(cf(ap, 2, 3.5) == 'c');
}
}
diff --git a/libcxx/test/utilities/function.objects/func.memfn/member_function_const_volatile.pass.cpp b/libcxx/test/utilities/function.objects/func.memfn/member_function_const_volatile.pass.cpp
index 1e00b4d..329ac16 100644
--- a/libcxx/test/utilities/function.objects/func.memfn/member_function_const_volatile.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.memfn/member_function_const_volatile.pass.cpp
@@ -33,6 +33,8 @@
assert(f(ap) == 'a');
const volatile A* cap = &a;
assert(f(cap) == 'a');
+ const F& cf = f;
+ assert(cf(ap) == 'a');
}
}
@@ -47,6 +49,8 @@
assert(f(ap, 2) == 'b');
const volatile A* cap = &a;
assert(f(cap, 2) == 'b');
+ const F& cf = f;
+ assert(cf(ap, 2) == 'b');
}
}
@@ -61,6 +65,8 @@
assert(f(ap, 2, 3.5) == 'c');
const volatile A* cap = &a;
assert(f(cap, 2, 3.5) == 'c');
+ const F& cf = f;
+ assert(cf(ap, 2, 3.5) == 'c');
}
}
diff --git a/libcxx/test/utilities/function.objects/func.memfn/member_function_volatile.pass.cpp b/libcxx/test/utilities/function.objects/func.memfn/member_function_volatile.pass.cpp
index 4d0654a..743ded9 100644
--- a/libcxx/test/utilities/function.objects/func.memfn/member_function_volatile.pass.cpp
+++ b/libcxx/test/utilities/function.objects/func.memfn/member_function_volatile.pass.cpp
@@ -33,6 +33,8 @@
assert(f(ap) == 'a');
volatile A* cap = &a;
assert(f(cap) == 'a');
+ const F& cf = f;
+ assert(cf(ap) == 'a');
}
}
@@ -47,6 +49,8 @@
assert(f(ap, 2) == 'b');
volatile A* cap = &a;
assert(f(cap, 2) == 'b');
+ const F& cf = f;
+ assert(cf(ap, 2) == 'b');
}
}
@@ -61,6 +65,8 @@
assert(f(ap, 2, 3.5) == 'c');
volatile A* cap = &a;
assert(f(cap, 2, 3.5) == 'c');
+ const F& cf = f;
+ assert(cf(ap, 2, 3.5) == 'c');
}
}