diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.compile.fail.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.verify.cpp rename from libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.compile.fail.cpp rename to libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.verify.cpp --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.compile.fail.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/derive_from.verify.cpp @@ -6,21 +6,19 @@ // //===----------------------------------------------------------------------===// -// UNSUPPORTED: c++03 -// XFAIL: c++11, c++14 +// UNSUPPORTED: c++03, c++11, c++14 // +// +// Make sure we can't initialize a std::function using an allocator (http://wg21.link/p0302r1). +// These constructors were removed in C++17. #include -#include - -#include "test_macros.h" +#include struct S : public std::function { using function::function; }; -int main(int, char**) { - S f1( [](){} ); - S f2(std::allocator_arg, std::allocator{}, f1); - - return 0; +void f() { + S f1( [](){} ); + S f2(std::allocator_arg, std::allocator{}, f1); // expected-error {{no matching constructor for initialization of 'S'}} } diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.fail.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.verify.cpp rename from libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.fail.cpp rename to libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.con/deduct_F.verify.cpp diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.compile.fail.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.verify.cpp rename from libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.compile.fail.cpp rename to libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.verify.cpp --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.compile.fail.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.verify.cpp @@ -6,6 +6,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++03 + // // class function @@ -15,33 +17,11 @@ #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); - } -} +// member data pointer: cv qualifiers should transfer from argument to return type -int main(int, char**) -{ - test_int_1(); +struct Foo { int data; }; - return 0; +void f() { + int Foo::*fp = &Foo::data; + std::function r2(fp); // expected-error {{no matching constructor for initialization of}} }