cxx/test/containers/sequences/list/db_cfront.pass.cpp
Howard Hinnant d4c96a6c89 Some debug test cases for list.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@178565 91177308-0d34-0410-b5e6-96231b3b80d8
2013-04-02 19:53:32 +00:00

40 lines
748 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.
//
//===----------------------------------------------------------------------===//
// <list>
// Call front() on empty const container.
#if _LIBCPP_DEBUG2 >= 1
#define _LIBCPP_ASSERT(x, m) ((x) ? (void)0 : std::exit(0))
#include <list>
#include <cassert>
#include <iterator>
#include <exception>
#include <cstdlib>
int main()
{
typedef int T;
typedef std::list<T> C;
const C c;
assert(c.front() == 0);
assert(false);
}
#else
int main()
{
}
#endif