cxx/test/libcxx/containers/sequences/deque/incomplete.pass.cpp
Evgeniy Stepanov 746572b91d 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.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@252350 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-06 22:02:29 +00:00

32 lines
681 B
C++

//===----------------------------------------------------------------------===//
//
// 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();
}