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