1 //===----------------------------------------------------------------------===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 // <codecvt> 10 11 // template <class Elem, unsigned long Maxcode = 0x10ffff, 12 // codecvt_mode Mode = (codecvt_mode)0> 13 // class codecvt_utf8 14 // : public codecvt<Elem, char, mbstate_t> 15 // { 16 // // unspecified 17 // }; 18 19 // Not a portable test 20 21 #include <codecvt> 22 #include <cstdlib> 23 #include <cassert> 24 25 #include "count_new.hpp" 26 27 int main(int, char**) 28 { 29 assert(globalMemCounter.checkOutstandingNewEq(0)); 30 { 31 typedef std::codecvt_utf8<wchar_t> C; 32 C c; 33 assert(globalMemCounter.checkOutstandingNewEq(0)); 34 } 35 { 36 typedef std::codecvt_utf8<wchar_t> C; 37 std::locale loc(std::locale::classic(), new C); 38 assert(globalMemCounter.checkOutstandingNewNotEq(0)); 39 } 40 assert(globalMemCounter.checkOutstandingNewEq(0)); 41 42 return 0; 43 } 44