summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std
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
commit8f56dedb5f6aaf7ccfe58885de6797ab55a573a6 (patch)
tree5dd02eeb107ecd02fb4d4c272cdd9eb52326880c /libcxx/test/std
parentb6c6eaf22624720cdf6982d06ac99a4372b1b4df (diff)
downloadbcm5719-llvm-8f56dedb5f6aaf7ccfe58885de6797ab55a573a6.tar.gz
bcm5719-llvm-8f56dedb5f6aaf7ccfe58885de6797ab55a573a6.zip
Replace _LIBCPP_HAS_NO_DELETED_FUNCTIONS with _LIBCPP_CXX03_LANG
llvm-svn: 291278
Diffstat (limited to 'libcxx/test/std')
-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
3 files changed, 60 insertions, 7 deletions
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); }
OpenPOWER on IntegriCloud