types.pass.cpp revision cedb7fcc10556aaf4302917913c672b1bc6a1db0
1e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher//===----------------------------------------------------------------------===// 2e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// 3e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// The LLVM Compiler Infrastructure 4e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// 5e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// This file is dual licensed under the MIT and the University of Illinois Open 6e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// Source Licenses. See LICENSE.TXT for details. 7e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// 8e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher//===----------------------------------------------------------------------===// 9e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// 10e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// This test uses new symbols that were not defined in the libc++ shipped on 11e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// darwin11 and darwin12: 12e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// XFAIL: with_system_lib=x86_64-apple-darwin11 13e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// XFAIL: with_system_lib=x86_64-apple-darwin12 14e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher 15e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// <locale> 16e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher 17e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// template <class _CharT, bool _International = false> 18e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// class moneypunct 19e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// : public locale::facet, 20e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// public money_base 21e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// { 22e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// public: 23e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// typedef _CharT char_type; 24e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// typedef basic_string<char_type> string_type; 25e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher// static const bool intl = International; 26e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher 27e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher#include <locale> 28e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher#include <type_traits> 29e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher 30e6869a8f59d779ff4d5a0984c86d80db7078496Marc Bouchertemplate <class _Tp> 31e6869a8f59d779ff4d5a0984c86d80db7078496Marc Bouchervoid test(const _Tp &) {} 32e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher 33e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucherint main() 34e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher{ 35e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher static_assert((std::is_base_of<std::locale::facet, std::moneypunct<char> >::value), ""); 36e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher static_assert((std::is_base_of<std::locale::facet, std::moneypunct<wchar_t> >::value), ""); 37e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher static_assert((std::is_base_of<std::money_base, std::moneypunct<char> >::value), ""); 38e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher static_assert((std::is_base_of<std::money_base, std::moneypunct<wchar_t> >::value), ""); 39e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher static_assert((std::is_same<std::moneypunct<char>::char_type, char>::value), ""); 40e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher static_assert((std::is_same<std::moneypunct<wchar_t>::char_type, wchar_t>::value), ""); 41e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher static_assert((std::is_same<std::moneypunct<char>::string_type, std::string>::value), ""); 42e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher static_assert((std::is_same<std::moneypunct<wchar_t>::string_type, std::wstring>::value), ""); 43e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher 44e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher test(std::moneypunct<char, false>::intl); 45e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher test(std::moneypunct<char, true>::intl); 46e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher test(std::moneypunct<wchar_t, false>::intl); 47e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher test(std::moneypunct<wchar_t, true>::intl); 48e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher} 49e6869a8f59d779ff4d5a0984c86d80db7078496Marc Boucher