From 1b3775e38c24eba35df0fc33b2780068822a8ce7 Mon Sep 17 00:00:00 2001 From: Pawel Wodnicki Date: Thu, 13 Dec 2012 16:31:31 +0000 Subject: [PATCH] Merging r170026: into the 3.2 release branch. 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/branches/release_32@170137 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/limits | 188 ++++++++++++++++++ include/locale | 4 + include/random | 122 ++++++++++++ include/regex | 21 ++ src/chrono.cpp | 4 + src/locale.cpp | 22 ++ .../const_data_members.pass.cpp | 185 +++++++++++++++++ .../category.ctype/ctype_base.pass.cpp | 16 ++ .../locale.moneypunct/types.pass.cpp | 9 + .../locale.category/category.pass.cpp | 13 ++ .../rand.adapt.disc/values.pass.cpp | 7 + .../rand.adapt.shuf/values.pass.cpp | 4 + .../rand.eng/rand.eng.lcong/values.pass.cpp | 7 + .../rand.eng/rand.eng.mers/values.pass.cpp | 31 +++ .../rand.eng/rand.eng.sub/values.pass.cpp | 11 + .../re.regex.const/constants.pass.cpp | 13 ++ .../time.clock.hires/consistency.pass.cpp | 4 + .../time.clock.steady/consistency.pass.cpp | 4 + .../time.clock.system/consistency.pass.cpp | 4 + 19 files changed, 669 insertions(+) create mode 100755 test/language.support/support.limits/limits/numeric.limits.members/const_data_members.pass.cpp diff --git a/include/limits b/include/limits index 68e63366a..f089a794d 100644 --- a/include/limits +++ b/include/limits @@ -478,6 +478,53 @@ public: static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style; }; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_specialized; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::digits; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::digits10; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_digits10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_signed; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_integer; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_exact; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::radix; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::min_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::min_exponent10; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits<_Tp>::max_exponent10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_infinity; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_quiet_NaN; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_signaling_NaN; +template + _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits<_Tp>::has_denorm; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::has_denorm_loss; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_iec559; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_bounded; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::is_modulo; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::traps; +template + _LIBCPP_CONSTEXPR const bool numeric_limits<_Tp>::tinyness_before; +template + _LIBCPP_CONSTEXPR const float_round_style numeric_limits<_Tp>::round_style; + template class _LIBCPP_VISIBLE numeric_limits : private numeric_limits<_Tp> @@ -524,6 +571,53 @@ public: static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style; }; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_specialized; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits10; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_digits10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_signed; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_integer; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_exact; +template + _LIBCPP_CONSTEXPR const int numeric_limits::radix; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent10; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_infinity; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_quiet_NaN; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_signaling_NaN; +template + _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits::has_denorm; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_denorm_loss; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_iec559; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_bounded; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_modulo; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::traps; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::tinyness_before; +template + _LIBCPP_CONSTEXPR const float_round_style numeric_limits::round_style; + template class _LIBCPP_VISIBLE numeric_limits : private numeric_limits<_Tp> @@ -570,6 +664,53 @@ public: static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style; }; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_specialized; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits10; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_digits10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_signed; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_integer; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_exact; +template + _LIBCPP_CONSTEXPR const int numeric_limits::radix; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent10; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_infinity; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_quiet_NaN; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_signaling_NaN; +template + _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits::has_denorm; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_denorm_loss; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_iec559; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_bounded; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_modulo; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::traps; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::tinyness_before; +template + _LIBCPP_CONSTEXPR const float_round_style numeric_limits::round_style; + template class _LIBCPP_VISIBLE numeric_limits : private numeric_limits<_Tp> @@ -616,6 +757,53 @@ public: static _LIBCPP_CONSTEXPR const float_round_style round_style = __base::round_style; }; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_specialized; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits; +template + _LIBCPP_CONSTEXPR const int numeric_limits::digits10; +template + const int numeric_limits::max_digits10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_signed; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_integer; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_exact; +template + _LIBCPP_CONSTEXPR const int numeric_limits::radix; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::min_exponent10; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent; +template + _LIBCPP_CONSTEXPR const int numeric_limits::max_exponent10; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_infinity; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_quiet_NaN; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_signaling_NaN; +template + _LIBCPP_CONSTEXPR const float_denorm_style numeric_limits::has_denorm; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::has_denorm_loss; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_iec559; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_bounded; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::is_modulo; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::traps; +template + _LIBCPP_CONSTEXPR const bool numeric_limits::tinyness_before; +template + _LIBCPP_CONSTEXPR const float_round_style numeric_limits::round_style; + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_LIMITS diff --git a/include/locale b/include/locale index 976c4cf50..e7c1b335f 100644 --- a/include/locale +++ b/include/locale @@ -2885,6 +2885,10 @@ template locale::id moneypunct<_CharT, _International>::id; +template +const bool +moneypunct<_CharT, _International>::intl; + _LIBCPP_EXTERN_TEMPLATE(class moneypunct) _LIBCPP_EXTERN_TEMPLATE(class moneypunct) _LIBCPP_EXTERN_TEMPLATE(class moneypunct) diff --git a/include/random b/include/random index d83828955..04d942bc8 100644 --- a/include/random +++ b/include/random @@ -1930,6 +1930,22 @@ private: linear_congruential_engine<_Up, _Ap, _Cp, _Np>& __x); }; +template + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::multiplier; + +template + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::increment; + +template + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::modulus; + +template + _LIBCPP_CONSTEXPR const typename linear_congruential_engine<_UIntType, __a, __c, __m>::result_type + linear_congruential_engine<_UIntType, __a, __c, __m>::default_seed; + template template void @@ -2227,6 +2243,90 @@ private: __rshift(result_type) {return result_type(0);} }; +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::word_size; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::state_size; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::shift_size; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::mask_bits; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::xor_mask; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_u; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_d; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_s; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_b; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_t; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_c; + +template + _LIBCPP_CONSTEXPR const size_t + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::tempering_l; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::initialization_multiplier; + +template + _LIBCPP_CONSTEXPR const typename mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type + mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::default_seed; + template @@ -2551,6 +2651,19 @@ private: void __seed(_Sseq& __q, integral_constant); }; +template + _LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::word_size; + +template + _LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::short_lag; + +template + _LIBCPP_CONSTEXPR const size_t subtract_with_carry_engine<_UIntType, __w, __s, __r>::long_lag; + +template + _LIBCPP_CONSTEXPR const typename subtract_with_carry_engine<_UIntType, __w, __s, __r>::result_type + subtract_with_carry_engine<_UIntType, __w, __s, __r>::default_seed; + template void subtract_with_carry_engine<_UIntType, __w, __s, __r>::seed(result_type __sd, @@ -2822,6 +2935,12 @@ public: discard_block_engine<_Eng, _Pp, _Rp>& __x); }; +template + _LIBCPP_CONSTEXPR const size_t discard_block_engine<_Engine, __p, __r>::block_size; + +template + _LIBCPP_CONSTEXPR const size_t discard_block_engine<_Engine, __p, __r>::used_block; + template typename discard_block_engine<_Engine, __p, __r>::result_type discard_block_engine<_Engine, __p, __r>::operator()() @@ -3314,6 +3433,9 @@ private: } }; +template + _LIBCPP_CONSTEXPR const size_t shuffle_order_engine<_Engine, __k>::table_size; + template bool operator==( diff --git a/include/regex b/include/regex index 7505f2ea3..982500f35 100644 --- a/include/regex +++ b/include/regex @@ -2842,6 +2842,27 @@ private: template friend class __lookahead; }; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::icase; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::nosubs; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::optimize; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::collate; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::ECMAScript; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::basic; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::extended; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::awk; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::grep; +template + const regex_constants::syntax_option_type basic_regex<_CharT, _Traits>::egrep; + template void basic_regex<_CharT, _Traits>::swap(basic_regex& __r) diff --git a/src/chrono.cpp b/src/chrono.cpp index 73c83ee08..1ce2e2807 100644 --- a/src/chrono.cpp +++ b/src/chrono.cpp @@ -24,6 +24,8 @@ namespace chrono // system_clock +const bool system_clock::is_steady; + system_clock::time_point system_clock::now() _NOEXCEPT { @@ -46,6 +48,8 @@ system_clock::from_time_t(time_t t) _NOEXCEPT // steady_clock +const bool steady_clock::is_steady; + #if __APPLE__ // mach_absolute_time() * MachInfo.numer / MachInfo.denom is the number of // nanoseconds since the computer booted up. MachInfo.numer and MachInfo.denom diff --git a/src/locale.cpp b/src/locale.cpp index 542c0d7a2..284bee7a0 100644 --- a/src/locale.cpp +++ b/src/locale.cpp @@ -83,6 +83,15 @@ make(A0 a0, A1 a1, A2 a2) } +const locale::category locale::none; +const locale::category locale::collate; +const locale::category locale::ctype; +const locale::category locale::monetary; +const locale::category locale::numeric; +const locale::category locale::time; +const locale::category locale::messages; +const locale::category locale::all; + #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wpadded" @@ -691,6 +700,19 @@ collate_byname::do_transform(const char_type* lo, const char_type* hi) // template <> class ctype; +const ctype_base::mask ctype_base::space; +const ctype_base::mask ctype_base::print; +const ctype_base::mask ctype_base::cntrl; +const ctype_base::mask ctype_base::upper; +const ctype_base::mask ctype_base::lower; +const ctype_base::mask ctype_base::alpha; +const ctype_base::mask ctype_base::digit; +const ctype_base::mask ctype_base::punct; +const ctype_base::mask ctype_base::xdigit; +const ctype_base::mask ctype_base::blank; +const ctype_base::mask ctype_base::alnum; +const ctype_base::mask ctype_base::graph; + locale::id ctype::id; ctype::~ctype() diff --git a/test/language.support/support.limits/limits/numeric.limits.members/const_data_members.pass.cpp b/test/language.support/support.limits/limits/numeric.limits.members/const_data_members.pass.cpp new file mode 100755 index 000000000..d6ae2284e --- /dev/null +++ b/test/language.support/support.limits/limits/numeric.limits.members/const_data_members.pass.cpp @@ -0,0 +1,185 @@ +//===----------------------------------------------------------------------===// +// +// 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. +// +//===----------------------------------------------------------------------===// + +#include + +/* +: + numeric_limits + is_specialized + digits + digits10 + max_digits10 + is_signed + is_integer + is_exact + radix + min_exponent + min_exponent10 + max_exponent + max_exponent10 + has_infinity + has_quiet_NaN + has_signaling_NaN + has_denorm + has_denorm_loss + is_iec559 + is_bounded + is_modulo + traps + tinyness_before + round_style +*/ + +template +void test(const _Tp &) {} + +#define TEST_NUMERIC_LIMITS(type) \ + test(std::numeric_limits::is_specialized); \ + test(std::numeric_limits::digits); \ + test(std::numeric_limits::digits10); \ + test(std::numeric_limits::max_digits10); \ + test(std::numeric_limits::is_signed); \ + test(std::numeric_limits::is_integer); \ + test(std::numeric_limits::is_exact); \ + test(std::numeric_limits::radix); \ + test(std::numeric_limits::min_exponent); \ + test(std::numeric_limits::min_exponent10); \ + test(std::numeric_limits::max_exponent); \ + test(std::numeric_limits::max_exponent10); \ + test(std::numeric_limits::has_infinity); \ + test(std::numeric_limits::has_quiet_NaN); \ + test(std::numeric_limits::has_signaling_NaN); \ + test(std::numeric_limits::has_denorm); \ + test(std::numeric_limits::has_denorm_loss); \ + test(std::numeric_limits::is_iec559); \ + test(std::numeric_limits::is_bounded); \ + test(std::numeric_limits::is_modulo); \ + test(std::numeric_limits::traps); \ + test(std::numeric_limits::tinyness_before); \ + test(std::numeric_limits::round_style); + +struct other {}; + +int main() +{ + // bool + TEST_NUMERIC_LIMITS(bool) + TEST_NUMERIC_LIMITS(const bool) + TEST_NUMERIC_LIMITS(volatile bool) + TEST_NUMERIC_LIMITS(const volatile bool) + + // char + TEST_NUMERIC_LIMITS(char) + TEST_NUMERIC_LIMITS(const char) + TEST_NUMERIC_LIMITS(volatile char) + TEST_NUMERIC_LIMITS(const volatile char) + + // signed char + TEST_NUMERIC_LIMITS(signed char) + TEST_NUMERIC_LIMITS(const signed char) + TEST_NUMERIC_LIMITS(volatile signed char) + TEST_NUMERIC_LIMITS(const volatile signed char) + + // unsigned char + TEST_NUMERIC_LIMITS(unsigned char) + TEST_NUMERIC_LIMITS(const unsigned char) + TEST_NUMERIC_LIMITS(volatile unsigned char) + TEST_NUMERIC_LIMITS(const volatile unsigned char) + + // wchar_t + TEST_NUMERIC_LIMITS(wchar_t) + TEST_NUMERIC_LIMITS(const wchar_t) + TEST_NUMERIC_LIMITS(volatile wchar_t) + TEST_NUMERIC_LIMITS(const volatile wchar_t) + + // char16_t + TEST_NUMERIC_LIMITS(char16_t) + TEST_NUMERIC_LIMITS(const char16_t) + TEST_NUMERIC_LIMITS(volatile char16_t) + TEST_NUMERIC_LIMITS(const volatile char16_t) + + // char32_t + TEST_NUMERIC_LIMITS(char32_t) + TEST_NUMERIC_LIMITS(const char32_t) + TEST_NUMERIC_LIMITS(volatile char32_t) + TEST_NUMERIC_LIMITS(const volatile char32_t) + + // short + TEST_NUMERIC_LIMITS(short) + TEST_NUMERIC_LIMITS(const short) + TEST_NUMERIC_LIMITS(volatile short) + TEST_NUMERIC_LIMITS(const volatile short) + + // int + TEST_NUMERIC_LIMITS(int) + TEST_NUMERIC_LIMITS(const int) + TEST_NUMERIC_LIMITS(volatile int) + TEST_NUMERIC_LIMITS(const volatile int) + + // long + TEST_NUMERIC_LIMITS(long) + TEST_NUMERIC_LIMITS(const long) + TEST_NUMERIC_LIMITS(volatile long) + TEST_NUMERIC_LIMITS(const volatile long) + + // long long + TEST_NUMERIC_LIMITS(long long) + TEST_NUMERIC_LIMITS(const long long) + TEST_NUMERIC_LIMITS(volatile long long) + TEST_NUMERIC_LIMITS(const volatile long long) + + // unsigned short + TEST_NUMERIC_LIMITS(unsigned short) + TEST_NUMERIC_LIMITS(const unsigned short) + TEST_NUMERIC_LIMITS(volatile unsigned short) + TEST_NUMERIC_LIMITS(const volatile unsigned short) + + // unsigned int + TEST_NUMERIC_LIMITS(unsigned int) + TEST_NUMERIC_LIMITS(const unsigned int) + TEST_NUMERIC_LIMITS(volatile unsigned int) + TEST_NUMERIC_LIMITS(const volatile unsigned int) + + // unsigned long + TEST_NUMERIC_LIMITS(unsigned long) + TEST_NUMERIC_LIMITS(const unsigned long) + TEST_NUMERIC_LIMITS(volatile unsigned long) + TEST_NUMERIC_LIMITS(const volatile unsigned long) + + // unsigned long long + TEST_NUMERIC_LIMITS(unsigned long long) + TEST_NUMERIC_LIMITS(const unsigned long long) + TEST_NUMERIC_LIMITS(volatile unsigned long long) + TEST_NUMERIC_LIMITS(const volatile unsigned long long) + + // float + TEST_NUMERIC_LIMITS(float) + TEST_NUMERIC_LIMITS(const float) + TEST_NUMERIC_LIMITS(volatile float) + TEST_NUMERIC_LIMITS(const volatile float) + + // double + TEST_NUMERIC_LIMITS(double) + TEST_NUMERIC_LIMITS(const double) + TEST_NUMERIC_LIMITS(volatile double) + TEST_NUMERIC_LIMITS(const volatile double) + + // long double + TEST_NUMERIC_LIMITS(long double) + TEST_NUMERIC_LIMITS(const long double) + TEST_NUMERIC_LIMITS(volatile long double) + TEST_NUMERIC_LIMITS(const volatile long double) + + // other + TEST_NUMERIC_LIMITS(other) + TEST_NUMERIC_LIMITS(const other) + TEST_NUMERIC_LIMITS(volatile other) + TEST_NUMERIC_LIMITS(const volatile other) +} diff --git a/test/localization/locale.categories/category.ctype/ctype_base.pass.cpp b/test/localization/locale.categories/category.ctype/ctype_base.pass.cpp index 9365b2656..497eaa3fe 100644 --- a/test/localization/locale.categories/category.ctype/ctype_base.pass.cpp +++ b/test/localization/locale.categories/category.ctype/ctype_base.pass.cpp @@ -31,6 +31,9 @@ #include #include +template +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); } diff --git a/test/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp b/test/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp index 7025ec9c5..0d616e35e 100644 --- a/test/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp +++ b/test/localization/locale.categories/category.monetary/locale.moneypunct/types.pass.cpp @@ -17,10 +17,14 @@ // public: // typedef _CharT char_type; // typedef basic_string string_type; +// static const bool intl = International; #include #include +template +void test(const _Tp &) {} + int main() { static_assert((std::is_base_of >::value), ""); @@ -31,4 +35,9 @@ int main() static_assert((std::is_same::char_type, wchar_t>::value), ""); static_assert((std::is_same::string_type, std::string>::value), ""); static_assert((std::is_same::string_type, std::wstring>::value), ""); + + test(std::moneypunct::intl); + test(std::moneypunct::intl); + test(std::moneypunct::intl); + test(std::moneypunct::intl); } diff --git a/test/localization/locales/locale/locale.types/locale.category/category.pass.cpp b/test/localization/locales/locale/locale.types/locale.category/category.pass.cpp index 0119b844a..b8ed5968e 100644 --- a/test/localization/locales/locale/locale.types/locale.category/category.pass.cpp +++ b/test/localization/locales/locale/locale.types/locale.category/category.pass.cpp @@ -15,6 +15,10 @@ #include #include +template +void test(const _Tp &) {} + + int main() { static_assert((std::is_same::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); } diff --git a/test/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp b/test/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp index 9a75b0b52..53e4c29af 100644 --- a/test/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp +++ b/test/numerics/rand/rand.adapt/rand.adapt.disc/values.pass.cpp @@ -26,6 +26,9 @@ #include #include +template +void where(const _Tp &) {} + void test1() { @@ -34,6 +37,8 @@ test1() static_assert((E::used_block == 23), ""); /*static_*/assert((E::min() == 0)/*, ""*/); /*static_*/assert((E::max() == 0xFFFFFF)/*, ""*/); + where(E::block_size); + where(E::used_block); } void @@ -44,6 +49,8 @@ test2() static_assert((E::used_block == 11), ""); /*static_*/assert((E::min() == 0)/*, ""*/); /*static_*/assert((E::max() == 0xFFFFFFFFFFFFull)/*, ""*/); + where(E::block_size); + where(E::used_block); } int main() diff --git a/test/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp b/test/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp index 0eb3b685d..eb42d644d 100644 --- a/test/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp +++ b/test/numerics/rand/rand.adapt/rand.adapt.shuf/values.pass.cpp @@ -25,6 +25,9 @@ #include #include +template +void where(const _Tp &) {} + void test1() { @@ -32,6 +35,7 @@ test1() static_assert(E::table_size == 256, ""); /*static_*/assert((E::min() == 1)/*, ""*/); /*static_*/assert((E::max() == 2147483646)/*, ""*/); + where(E::table_size); } int main() diff --git a/test/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp b/test/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp index 978eecc9f..857a478a5 100644 --- a/test/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp +++ b/test/numerics/rand/rand.eng/rand.eng.lcong/values.pass.cpp @@ -25,6 +25,9 @@ #include #include +template +void where(const _Tp &) {} + template void test1() @@ -37,6 +40,10 @@ test1() /*static_*/assert((LCE::min() == (c == 0u ? 1u: 0u))/*, ""*/); /*static_*/assert((LCE::max() == result_type(m - 1u))/*, ""*/); static_assert((LCE::default_seed == 1), ""); + where(LCE::multiplier); + where(LCE::increment); + where(LCE::modulus); + where(LCE::default_seed); } template diff --git a/test/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp b/test/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp index 558d0e784..331d3c511 100644 --- a/test/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp +++ b/test/numerics/rand/rand.eng/rand.eng.mers/values.pass.cpp @@ -40,6 +40,9 @@ #include #include +template +void where(const _Tp &) {} + void test1() { @@ -60,6 +63,20 @@ test1() /*static_*/assert((E::min() == 0)/*, ""*/); /*static_*/assert((E::max() == 0xFFFFFFFF)/*, ""*/); static_assert((E::default_seed == 5489u), ""); + where(E::word_size); + where(E::state_size); + where(E::shift_size); + where(E::mask_bits); + where(E::xor_mask); + where(E::tempering_u); + where(E::tempering_d); + where(E::tempering_s); + where(E::tempering_b); + where(E::tempering_t); + where(E::tempering_c); + where(E::tempering_l); + where(E::initialization_multiplier); + where(E::default_seed); } void @@ -82,6 +99,20 @@ test2() /*static_*/assert((E::min() == 0)/*, ""*/); /*static_*/assert((E::max() == 0xFFFFFFFFFFFFFFFFull)/*, ""*/); static_assert((E::default_seed == 5489u), ""); + where(E::word_size); + where(E::state_size); + where(E::shift_size); + where(E::mask_bits); + where(E::xor_mask); + where(E::tempering_u); + where(E::tempering_d); + where(E::tempering_s); + where(E::tempering_b); + where(E::tempering_t); + where(E::tempering_c); + where(E::tempering_l); + where(E::initialization_multiplier); + where(E::default_seed); } int main() diff --git a/test/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp b/test/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp index 84342a226..75716a43d 100644 --- a/test/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp +++ b/test/numerics/rand/rand.eng/rand.eng.sub/values.pass.cpp @@ -28,6 +28,9 @@ #include #include +template +void where(const _Tp &) {} + void test1() { @@ -38,6 +41,10 @@ test1() /*static_*/assert((E::min() == 0)/*, ""*/); /*static_*/assert((E::max() == 0xFFFFFF)/*, ""*/); static_assert((E::default_seed == 19780503u), ""); + where(E::word_size); + where(E::short_lag); + where(E::long_lag); + where(E::default_seed); } void @@ -50,6 +57,10 @@ test2() /*static_*/assert((E::min() == 0)/*, ""*/); /*static_*/assert((E::max() == 0xFFFFFFFFFFFFull)/*, ""*/); static_assert((E::default_seed == 19780503u), ""); + where(E::word_size); + where(E::short_lag); + where(E::long_lag); + where(E::default_seed); } int main() diff --git a/test/re/re.regex/re.regex.const/constants.pass.cpp b/test/re/re.regex/re.regex.const/constants.pass.cpp index 4db5a3714..85297b91f 100644 --- a/test/re/re.regex/re.regex.const/constants.pass.cpp +++ b/test/re/re.regex/re.regex.const/constants.pass.cpp @@ -28,6 +28,9 @@ #include #include +template +void where(const _Tp &) {} + template void test() @@ -43,6 +46,16 @@ test() static_assert((BR::awk == std::regex_constants::awk), ""); static_assert((BR::grep == std::regex_constants::grep), ""); static_assert((BR::egrep == std::regex_constants::egrep), ""); + where(BR::icase); + where(BR::nosubs); + where(BR::optimize); + where(BR::collate); + where(BR::ECMAScript); + where(BR::basic); + where(BR::extended); + where(BR::awk); + where(BR::grep); + where(BR::egrep); } int main() diff --git a/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp b/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp index e761c96e4..3abf4320e 100644 --- a/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp +++ b/test/utilities/time/time.clock/time.clock.hires/consistency.pass.cpp @@ -15,6 +15,9 @@ #include +template +void test(const _Tp &) {} + int main() { typedef std::chrono::high_resolution_clock C; @@ -22,4 +25,5 @@ int main() static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert(C::is_steady || !C::is_steady, ""); + test(std::chrono::high_resolution_clock::is_steady); } diff --git a/test/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp b/test/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp index a325fa245..5e42dc9cd 100644 --- a/test/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp +++ b/test/utilities/time/time.clock/time.clock.steady/consistency.pass.cpp @@ -15,6 +15,9 @@ #include +template +void test(const _Tp &) {} + int main() { typedef std::chrono::steady_clock C; @@ -22,4 +25,5 @@ int main() static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert(C::is_steady, ""); + test(std::chrono::steady_clock::is_steady); } diff --git a/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp b/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp index 5029b55b1..4182384db 100644 --- a/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp +++ b/test/utilities/time/time.clock/time.clock.system/consistency.pass.cpp @@ -15,6 +15,9 @@ #include +template +void test(const _Tp &) {} + int main() { typedef std::chrono::system_clock C; @@ -23,4 +26,5 @@ int main() static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((C::is_steady || !C::is_steady), ""); + test(std::chrono::system_clock::is_steady); }