From 61b9a7258a7693d7f3674a5a1daf7b036ff1d382 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Sun, 6 Sep 2015 18:46:46 +0000 Subject: Import libc++ 3.7.0 release (r246257). --- .../func.wrap.func.inv/invoke.fail.cpp | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp (limited to 'test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp') diff --git a/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp new file mode 100644 index 000000000000..6dcd2857452c --- /dev/null +++ b/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.fail.cpp @@ -0,0 +1,46 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// + +// class function + +// R operator()(ArgTypes... args) const + +#include +#include + +// member data pointer: cv qualifiers should transfer from argument to return type + +struct A_int_1 +{ + A_int_1() : data_(5) {} + + int data_; +}; + +void +test_int_1() +{ + // member data pointer + { + int A_int_1::*fp = &A_int_1::data_; + A_int_1 a; + std::function r2(fp); + const A_int_1* ap = &a; + assert(r2(ap) == 6); + r2(ap) = 7; + assert(r2(ap) == 7); + } +} + +int main() +{ + test_int_1(); +} -- cgit v1.3