summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/libcxx/iterators/trivial_iterators.pass.cpp3
-rw-r--r--libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/copy.fail.cpp55
-rw-r--r--libcxx/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp8
-rw-r--r--libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h4
-rw-r--r--libcxx/test/support/test_iterators.h2
5 files changed, 63 insertions, 9 deletions
diff --git a/libcxx/test/libcxx/iterators/trivial_iterators.pass.cpp b/libcxx/test/libcxx/iterators/trivial_iterators.pass.cpp
index c4b3aae92ff..d924a57ffea 100644
--- a/libcxx/test/libcxx/iterators/trivial_iterators.pass.cpp
+++ b/libcxx/test/libcxx/iterators/trivial_iterators.pass.cpp
@@ -25,9 +25,10 @@
#include <vector>
#include <initializer_list>
+#include "test_macros.h"
#include "test_iterators.h"
-#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+#if TEST_STD_VER >= 11
#define DELETE_FUNCTION = delete
#else
#define DELETE_FUNCTION
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
+
+// <istream>
+
+// template <class charT, class traits = char_traits<charT> >
+// class basic_istream;
+
+// basic_istream(basic_istream const& rhs) = delete;
+// basic_istream& operator=(basic_istream const&) = delete;
+
+#include <istream>
+#include <type_traits>
+#include <cassert>
+
+struct test_istream
+ : public std::basic_istream<char>
+{
+ typedef std::basic_istream<char> 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<char>'}}
+ {
+ }
+
+ 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
+
// <istream>
// template <class charT, class traits = char_traits<charT> >
@@ -17,8 +19,6 @@
#include <istream>
#include <cassert>
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-
template <class CharT>
struct testbuf
: public std::basic_streambuf<CharT>
@@ -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<char> sb;
test_istream<char> 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 <type_traits>
#include <cassert>
-#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); }
diff --git a/libcxx/test/support/test_iterators.h b/libcxx/test/support/test_iterators.h
index 379933eb51b..a2c22b09de8 100644
--- a/libcxx/test/support/test_iterators.h
+++ b/libcxx/test/support/test_iterators.h
@@ -17,7 +17,7 @@
#include "test_macros.h"
-#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
+#if TEST_STD_VER >= 11
#define DELETE_FUNCTION = delete
#else
#define DELETE_FUNCTION
OpenPOWER on IntegriCloud