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.


git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@245806 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Fiselier
2015-08-23 02:56:05 +00:00
parent d686dda62e
commit bb2f28e15d
3 changed files with 46 additions and 39 deletions

View File

@@ -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;
}