summaryrefslogtreecommitdiffstats
path: root/libcxx/test
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2015-11-06 22:02:29 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2015-11-06 22:02:29 +0000
commit65da7bc3929baa1374bf1fa76fbabba26d292e42 (patch)
tree413c5e59a1db958d2c0b8754a32f5026636853b6 /libcxx/test
parent05691a678ed6d76c1d022bfb49ab38f4a0ec1966 (diff)
downloadbcm5719-llvm-65da7bc3929baa1374bf1fa76fbabba26d292e42.tar.gz
bcm5719-llvm-65da7bc3929baa1374bf1fa76fbabba26d292e42.zip
Allow deque to handle incomplete types.
Allow deque and deque::iterator instantiation with incomplete element type. This is an ABI breaking change, and it is only enabled if LIBCXX_ABI_VERSION >= 2 or LIBCXX_ABI_UNSTABLE=ON. llvm-svn: 252350
Diffstat (limited to 'libcxx/test')
-rw-r--r--libcxx/test/libcxx/containers/sequences/deque/incomplete.pass.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/libcxx/test/libcxx/containers/sequences/deque/incomplete.pass.cpp b/libcxx/test/libcxx/containers/sequences/deque/incomplete.pass.cpp
new file mode 100644
index 00000000000..dbeea5f9aef
--- /dev/null
+++ b/libcxx/test/libcxx/containers/sequences/deque/incomplete.pass.cpp
@@ -0,0 +1,31 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <deque>
+
+// deque()
+// deque::iterator()
+
+#define _LIBCPP_ABI_INCOMPLETE_TYPES_IN_DEQUE
+#include <deque>
+#include <cassert>
+
+struct A {
+ std::deque<A> d;
+ std::deque<A>::iterator it;
+ std::deque<A>::reverse_iterator it2;
+};
+
+int main()
+{
+ A a;
+ assert(a.d.size() == 0);
+ a.it = a.d.begin();
+ a.it2 = a.d.rend();
+}
OpenPOWER on IntegriCloud