Home | History | Annotate | Download | only in locale.stdcvt
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <codecvt>
     11 
     12 // template <class Elem, unsigned long Maxcode = 0x10ffff,
     13 //           codecvt_mode Mode = (codecvt_mode)0>
     14 // class codecvt_utf8
     15 //     : public codecvt<Elem, char, mbstate_t>
     16 // {
     17 //     // unspecified
     18 // };
     19 
     20 // Not a portable test
     21 
     22 #include <codecvt>
     23 #include <cstdlib>
     24 #include <cassert>
     25 
     26 #include "count_new.hpp"
     27 
     28 int main()
     29 {
     30     assert(globalMemCounter.checkOutstandingNewEq(0));
     31     {
     32         typedef std::codecvt_utf8<wchar_t> C;
     33         C c;
     34         assert(globalMemCounter.checkOutstandingNewEq(0));
     35     }
     36     {
     37         typedef std::codecvt_utf8<wchar_t> C;
     38         std::locale loc(std::locale::classic(), new C);
     39         assert(globalMemCounter.checkOutstandingNewNotEq(0));
     40     }
     41     assert(globalMemCounter.checkOutstandingNewEq(0));
     42 }
     43