1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template <> class ctype<char>
20 unsigned delete_called = 0;
22 void* operator new[](size_t sz) throw(std::bad_alloc)
24 return operator new(sz);
27 void operator delete[](void* p) throw()
37 std::locale l(std::locale::classic(), new std::ctype<char>);
38 assert(delete_called == 0);
40 assert(delete_called == 0);
42 std::ctype<char>::mask table[256];
44 std::locale l(std::locale::classic(), new std::ctype<char>(table));
45 assert(delete_called == 0);
47 assert(delete_called == 0);
50 std::locale l(std::locale::classic(),
51 new std::ctype<char>(new std::ctype<char>::mask[256], true));
52 assert(delete_called == 0);
54 assert(delete_called == 1);