wchar_t_max_length.pass.cpp revision f5256e16dfc425c1d466f6308d4026d529ce9e0b
13c827367444ee418f129b2c238299f49d3264554Jarkko Poyry//===----------------------------------------------------------------------===// 23c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// 33c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// The LLVM Compiler Infrastructure 43c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// 53c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// This file is distributed under the University of Illinois Open Source 63c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// License. See LICENSE.TXT for details. 73c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// 83c827367444ee418f129b2c238299f49d3264554Jarkko Poyry//===----------------------------------------------------------------------===// 93c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 103c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// <locale> 113c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 123c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// template <> class codecvt<wchar_t, char, mbstate_t> 133c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 143c827367444ee418f129b2c238299f49d3264554Jarkko Poyry// int max_length() const throw(); 153c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 163c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include <locale> 173c827367444ee418f129b2c238299f49d3264554Jarkko Poyry#include <cassert> 183c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 193c827367444ee418f129b2c238299f49d3264554Jarkko Poyrytypedef std::codecvt<wchar_t, char, std::mbstate_t> F; 203c827367444ee418f129b2c238299f49d3264554Jarkko Poyry 213c827367444ee418f129b2c238299f49d3264554Jarkko Poyryint main() 223c827367444ee418f129b2c238299f49d3264554Jarkko Poyry{ 233c827367444ee418f129b2c238299f49d3264554Jarkko Poyry std::locale l = std::locale::classic(); 243c827367444ee418f129b2c238299f49d3264554Jarkko Poyry const F& f = std::use_facet<F>(l); 253c827367444ee418f129b2c238299f49d3264554Jarkko Poyry assert(f.max_length() == 1); 263c827367444ee418f129b2c238299f49d3264554Jarkko Poyry} 273c827367444ee418f129b2c238299f49d3264554Jarkko Poyry