More vector debug tests.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178033 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2013-03-26 15:45:56 +00:00
parent c3a9b81e67
commit d1c0082675
6 changed files with 103 additions and 0 deletions

View File

@@ -11,6 +11,10 @@
// template <class... Args> iterator emplace(const_iterator pos, Args&&... args);
#if _LIBCPP_DEBUG2 >= 1
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
#endif
#include <vector>
#include <cassert>
#include "../../../stack_allocator.h"
@@ -102,5 +106,13 @@ int main()
assert(c.back().geti() == 3);
assert(c.back().getd() == 4.5);
}
#if _LIBCPP_DEBUG2 >= 1
{
std::vector<A> c1;
std::vector<A> c2;
std::vector<A>::iterator i = c1.emplace(c2.cbegin(), 2, 3.5);
assert(false);
}
#endif
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
}