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:
27
test/std/containers/sequences/list/incomplete_type.pass.cpp
Normal file
27
test/std/containers/sequences/list/incomplete_type.pass.cpp
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user