diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2014-01-22 22:56:52 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2014-01-22 22:56:52 +0000 |
commit | a5adf489b74dc8cc90340d0c304e30346dcf5cf2 (patch) | |
tree | c5f7497d0dca68ff13341ac32160c49c84abd91f /libcxx/test/utilities/function.objects/func.memfn | |
parent | 77e4d444113557c62add7919204d81f60c772ce4 (diff) | |
download | bcm5719-llvm-a5adf489b74dc8cc90340d0c304e30346dcf5cf2.tar.gz bcm5719-llvm-a5adf489b74dc8cc90340d0c304e30346dcf5cf2.zip |
Const qualify __mem_fn call operator
QOI improvement.
Differential Revision: http://llvm-reviews.chandlerc.com/D2059
llvm-svn: 199848
Diffstat (limited to 'libcxx/test/utilities/function.objects/func.memfn')
5 files changed, 26 insertions, 0 deletions
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 048fca4d96e..dff211c6057 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 @@ test(F f) 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 01a5f8e551a..4096bd81442 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 @@ test0(F f) assert(f(a) == 'a'); A* ap = &a; assert(f(ap) == 'a'); + const F& cf = f; + assert(cf(ap) == 'a'); } } @@ -43,6 +45,8 @@ test1(F f) 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 @@ test2(F f) 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 978f9f094fb..be22443e954 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 @@ test0(F f) assert(f(ap) == 'a'); const A* cap = &a; assert(f(cap) == 'a'); + const F& cf = f; + assert(cf(ap) == 'a'); } } @@ -47,6 +49,8 @@ test1(F f) 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 @@ test2(F f) 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 1e00b4d6b84..329ac16a86d 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 @@ test0(F f) 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 @@ test1(F f) 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 @@ test2(F f) 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 4d0654a9f75..743ded9944a 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 @@ test0(F f) assert(f(ap) == 'a'); volatile A* cap = &a; assert(f(cap) == 'a'); + const F& cf = f; + assert(cf(ap) == 'a'); } } @@ -47,6 +49,8 @@ test1(F f) 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 @@ test2(F f) 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'); } } |