Zhang Xiongpang: Add definitions for const data members. Fixes http://llvm.org/bugs/show_bug.cgi?id=14585.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@170026 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -31,6 +31,9 @@
|
||||
#include <locale>
|
||||
#include <cassert>
|
||||
|
||||
template <class _Tp>
|
||||
void test(const _Tp &) {}
|
||||
|
||||
int main()
|
||||
{
|
||||
assert(std::ctype_base::space);
|
||||
@@ -54,4 +57,17 @@ int main()
|
||||
& std::ctype_base::xdigit) == 0);
|
||||
assert(std::ctype_base::alnum == (std::ctype_base::alpha | std::ctype_base::digit));
|
||||
assert(std::ctype_base::graph == (std::ctype_base::alnum | std::ctype_base::punct));
|
||||
|
||||
test(std::ctype_base::space);
|
||||
test(std::ctype_base::print);
|
||||
test(std::ctype_base::cntrl);
|
||||
test(std::ctype_base::upper);
|
||||
test(std::ctype_base::lower);
|
||||
test(std::ctype_base::alpha);
|
||||
test(std::ctype_base::digit);
|
||||
test(std::ctype_base::punct);
|
||||
test(std::ctype_base::xdigit);
|
||||
test(std::ctype_base::blank);
|
||||
test(std::ctype_base::alnum);
|
||||
test(std::ctype_base::graph);
|
||||
}
|
||||
|
@@ -17,10 +17,14 @@
|
||||
// public:
|
||||
// typedef _CharT char_type;
|
||||
// typedef basic_string<char_type> string_type;
|
||||
// static const bool intl = International;
|
||||
|
||||
#include <locale>
|
||||
#include <type_traits>
|
||||
|
||||
template <class _Tp>
|
||||
void test(const _Tp &) {}
|
||||
|
||||
int main()
|
||||
{
|
||||
static_assert((std::is_base_of<std::locale::facet, std::moneypunct<char> >::value), "");
|
||||
@@ -31,4 +35,9 @@ int main()
|
||||
static_assert((std::is_same<std::moneypunct<wchar_t>::char_type, wchar_t>::value), "");
|
||||
static_assert((std::is_same<std::moneypunct<char>::string_type, std::string>::value), "");
|
||||
static_assert((std::is_same<std::moneypunct<wchar_t>::string_type, std::wstring>::value), "");
|
||||
|
||||
test(std::moneypunct<char, false>::intl);
|
||||
test(std::moneypunct<char, true>::intl);
|
||||
test(std::moneypunct<wchar_t, false>::intl);
|
||||
test(std::moneypunct<wchar_t, true>::intl);
|
||||
}
|
||||
|
@@ -15,6 +15,10 @@
|
||||
#include <type_traits>
|
||||
#include <cassert>
|
||||
|
||||
template <class _Tp>
|
||||
void test(const _Tp &) {}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
static_assert((std::is_same<std::locale::category, int>::value), "");
|
||||
@@ -38,4 +42,13 @@ int main()
|
||||
| std::locale::time
|
||||
| std::locale::messages)
|
||||
== std::locale::all);
|
||||
|
||||
test(std::locale::none);
|
||||
test(std::locale::collate);
|
||||
test(std::locale::ctype);
|
||||
test(std::locale::monetary);
|
||||
test(std::locale::numeric);
|
||||
test(std::locale::time);
|
||||
test(std::locale::messages);
|
||||
test(std::locale::all);
|
||||
}
|
||||
|
Reference in New Issue
Block a user