//===----------------------------------------------------------------------===// // // 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. // //===----------------------------------------------------------------------===// // REQUIRES: locale.en_US.UTF-8 // // locale() throw(); #include #include #include "platform_support.h" // locale name macros #include "count_new.hpp" void check(const std::locale& loc) { assert(std::has_facet >(loc)); assert(std::has_facet >(loc)); assert(std::has_facet >(loc)); assert(std::has_facet >(loc)); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); } int main() { int ok; { std::locale loc; assert(globalMemCounter.checkOutstandingNewEq(0)); assert(loc.name() == "C"); assert(globalMemCounter.checkOutstandingNewEq(0)); check(loc); assert(globalMemCounter.checkOutstandingNewEq(0)); assert(std::locale::global(std::locale(LOCALE_en_US_UTF_8)) == loc); ok = globalMemCounter.outstanding_new; std::locale loc2; assert(globalMemCounter.checkOutstandingNewEq(ok)); check(loc2); assert(globalMemCounter.checkOutstandingNewEq(ok)); assert(loc2 == std::locale(LOCALE_en_US_UTF_8)); assert(globalMemCounter.checkOutstandingNewEq(ok)); } assert(globalMemCounter.checkOutstandingNewEq(ok)); }