From 8f56dedb5f6aaf7ccfe58885de6797ab55a573a6 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Fri, 6 Jan 2017 20:58:25 +0000 Subject: Replace _LIBCPP_HAS_NO_DELETED_FUNCTIONS with _LIBCPP_CXX03_LANG llvm-svn: 291278 --- .../istream/istream.cons/copy.fail.cpp | 55 ++++++++++++++++++++++ .../istream/istream.cons/move.pass.cpp | 8 +--- .../util.smartptr.shared/test_deleter.h | 4 +- 3 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/copy.fail.cpp (limited to 'libcxx/test/std') diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/copy.fail.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/copy.fail.cpp new file mode 100644 index 00000000000..c5721f211ab --- /dev/null +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/copy.fail.cpp @@ -0,0 +1,55 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +// UNSUPPORTED: c++98, c++03 + +// + +// template > +// class basic_istream; + +// basic_istream(basic_istream const& rhs) = delete; +// basic_istream& operator=(basic_istream const&) = delete; + +#include +#include +#include + +struct test_istream + : public std::basic_istream +{ + typedef std::basic_istream base; + + test_istream(test_istream&& s) + : base(std::move(s)) // OK + { + } + + test_istream& operator=(test_istream&& s) { + base::operator=(std::move(s)); // OK + return *this; + } + + test_istream(test_istream const& s) + : base(s) // expected-error {{call to deleted constructor of 'std::basic_istream'}} + { + } + + test_istream& operator=(test_istream const& s) { + base::operator=(s); // expected-error {{call to deleted member function 'operator='}} + return *this; + } + +}; + + +int main() +{ + +} diff --git a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp index 04cb9d3fb6b..6e00f399306 100644 --- a/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03 + // // template > @@ -17,8 +19,6 @@ #include #include -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template struct testbuf : public std::basic_streambuf @@ -37,11 +37,8 @@ struct test_istream : base(std::move(s)) {} }; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - int main() { -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES { testbuf sb; test_istream is1(&sb); @@ -74,5 +71,4 @@ int main() assert(is.precision() == 6); assert(is.getloc().name() == "C"); } -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES } diff --git a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h index bae1e013f57..6b3f1e2ab0d 100644 --- a/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h +++ b/libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h @@ -19,7 +19,9 @@ #include #include -#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS +#include "test_macros.h" + +#if TEST_STD_VER >= 11 #define DELETE_FUNCTION = delete #else #define DELETE_FUNCTION { assert(false); } -- cgit v1.2.3