summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-01-06 20:58:25 +0000
committerEric Fiselier <eric@efcs.ca>2017-01-06 20:58:25 +0000
commit8eb066a1066b286c66109750cd7a91ed5a7693e7 (patch)
tree642c237991ffd199d929b33a6b3b78618ecb5464 /test
parent66134e8a5f7fc172dcc9124349047bb793affbaa (diff)
downloadlibcxx-8eb066a1066b286c66109750cd7a91ed5a7693e7.tar.gz
Replace _LIBCPP_HAS_NO_DELETED_FUNCTIONS with _LIBCPP_CXX03_LANG
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@291278 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/libcxx/iterators/trivial_iterators.pass.cpp3
-rw-r--r--test/std/input.output/iostream.format/input.streams/istream/istream.cons/copy.fail.cpp55
-rw-r--r--test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp8
-rw-r--r--test/std/utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h4
-rw-r--r--test/support/test_iterators.h2
5 files changed, 63 insertions, 9 deletions
diff --git a/test/libcxx/iterators/trivial_iterators.pass.cpp b/test/libcxx/iterators/trivial_iterators.pass.cpp
index c4b3aae92..d924a57ff 100644
--- a/test/libcxx/iterators/trivial_iterators.pass.cpp
+++ b/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/test/std/input.output/iostream.format/input.streams/istream/istream.cons/copy.fail.cpp b/test/std/input.output/iostream.format/input.streams/istream/istream.cons/copy.fail.cpp
new file mode 100644
index 000000000..c5721f211
--- /dev/null
+++ b/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/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp b/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp
index 04cb9d3fb..6e00f3993 100644
--- a/test/std/input.output/iostream.format/input.streams/istream/istream.cons/move.pass.cpp
+++ b/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/test/std/utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h b/test/std/utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h
index bae1e013f..6b3f1e2ab 100644
--- a/test/std/utilities/memory/util.smartptr/util.smartptr.shared/test_deleter.h
+++ b/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/test/support/test_iterators.h b/test/support/test_iterators.h
index 379933eb5..a2c22b09d 100644
--- a/test/support/test_iterators.h
+++ b/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