summaryrefslogtreecommitdiffstats
path: root/libcxx/test/std
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2015-08-23 02:56:05 +0000
committerEric Fiselier <eric@efcs.ca>2015-08-23 02:56:05 +0000
commit1c813407976686f09096406b1d3141290dd93e61 (patch)
treead9b879581984e7d4a1cafeef6b174d3fc7c9b10 /libcxx/test/std
parent236f405b1d1897253419e212ee8343c308e2259c (diff)
downloadbcm5719-llvm-1c813407976686f09096406b1d3141290dd93e61.tar.gz
bcm5719-llvm-1c813407976686f09096406b1d3141290dd93e61.zip
Recommit rL245802: Cleanup fancy pointer rebinding in list using __rebind_pointer.
Currently we need an #ifdef branch every time we use pointer traits to rebind a pointer because it is done differently in C++11 and C++03. This patch introduces the __rebind_pointer utility to clean this up. Also add a test that list and it's iterators can be instantiated with incomplete element types. llvm-svn: 245806
Diffstat (limited to 'libcxx/test/std')
-rw-r--r--libcxx/test/std/containers/sequences/list/incomplete_type.pass.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/libcxx/test/std/containers/sequences/list/incomplete_type.pass.cpp b/libcxx/test/std/containers/sequences/list/incomplete_type.pass.cpp
new file mode 100644
index 00000000000..adfb4d45fc8
--- /dev/null
+++ b/libcxx/test/std/containers/sequences/list/incomplete_type.pass.cpp
@@ -0,0 +1,27 @@
+//===----------------------------------------------------------------------===//
+//
+// 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.
+//
+//===----------------------------------------------------------------------===//
+
+// <list>
+
+// Check that std::list and it's iterators can be instantiated with an incomplete
+// type.
+
+#include <list>
+
+struct A {
+ std::list<A> l;
+ std::list<A>::iterator it;
+ std::list<A>::const_iterator cit;
+ std::list<A>::reverse_iterator rit;
+ std::list<A>::const_reverse_iterator crit;
+};
+
+int main() {
+ A a;
+}
OpenPOWER on IntegriCloud