15a83710eSEric Fiselier //===----------------------------------------------------------------------===// 25a83710eSEric Fiselier // 357b08b09SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 457b08b09SChandler Carruth // See https://llvm.org/LICENSE.txt for license information. 557b08b09SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 65a83710eSEric Fiselier // 75a83710eSEric Fiselier //===----------------------------------------------------------------------===// 85a83710eSEric Fiselier 95a83710eSEric Fiselier // <codecvt> 105a83710eSEric Fiselier 11*3ee9a50aSNikolas Klauser // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS 12*3ee9a50aSNikolas Klauser 135a83710eSEric Fiselier // template <class Elem, unsigned long Maxcode = 0x10ffff, 145a83710eSEric Fiselier // codecvt_mode Mode = (codecvt_mode)0> 155a83710eSEric Fiselier // class codecvt_utf8 165a83710eSEric Fiselier // : public codecvt<Elem, char, mbstate_t> 175a83710eSEric Fiselier // { 185a83710eSEric Fiselier // // unspecified 195a83710eSEric Fiselier // }; 205a83710eSEric Fiselier 21a7f9895cSLouis Dionne // XFAIL: no-wide-characters 22f4c1258dSLouis Dionne 235a83710eSEric Fiselier // Not a portable test 245a83710eSEric Fiselier 255a83710eSEric Fiselier #include <codecvt> 265a83710eSEric Fiselier #include <cstdlib> 275a83710eSEric Fiselier #include <cassert> 285a83710eSEric Fiselier 29cc89063bSNico Weber #include "count_new.h" 305a83710eSEric Fiselier 317fc6a556SMarshall Clow #include "test_macros.h" 327fc6a556SMarshall Clow main(int,char **)332df59c50SJF Bastienint main(int, char**) 345a83710eSEric Fiselier { 359c5d0ea6SDan Albert globalMemCounter.reset(); 362cbc654dSEric Fiselier assert(globalMemCounter.checkOutstandingNewEq(0)); 375a83710eSEric Fiselier { 385a83710eSEric Fiselier typedef std::codecvt_utf8<wchar_t> C; 395a83710eSEric Fiselier C c; 402cbc654dSEric Fiselier assert(globalMemCounter.checkOutstandingNewEq(0)); 415a83710eSEric Fiselier } 425a83710eSEric Fiselier { 435a83710eSEric Fiselier typedef std::codecvt_utf8<wchar_t> C; 445a83710eSEric Fiselier std::locale loc(std::locale::classic(), new C); 452cbc654dSEric Fiselier assert(globalMemCounter.checkOutstandingNewNotEq(0)); 465a83710eSEric Fiselier } 472cbc654dSEric Fiselier assert(globalMemCounter.checkOutstandingNewEq(0)); 482df59c50SJF Bastien 492df59c50SJF Bastien return 0; 505a83710eSEric Fiselier } 51