Hide
LIBCXX/libcxx/include/random shown below uses unsigned instead of unsigned long for the "32" bit case of __lce_ta:
// 32
template <unsigned long long _Ap, unsigned long long _Cp, unsigned long long _Mp>
struct __lce_ta<_Ap, _Cp, _Mp, (unsigned long)(~0), true>
{
typedef unsigned long result_type;
...
armcl/clang both compile with no errors.
msp430, however, has 16bit "unsigned" and fails with below error due to above issue where "unsigned" is used for 32 bit. It should use unsigned long instead:
"random", line 1890: error: incomplete type is not allowed
detected during:
instantiation of "std::__2::linear_congruential_engine<_UIntType, __a, __c, __m>::result_type std::__2::linear_congruential_engine<_UIntType, __a, __c, __m>::operator()() [with _UIntType=uint_fast32_t, __a=40014UL, __c=0UL, __m=2147483563UL]" at line 2651
instantiation of "void std::__2::subtract_with_carry_engine<_UIntType, __w, __s, __r>::seed(std::__2::subtract_with_carry_engine<_UIntType, __w, __s, __r>::result_type, std::__2::integral_constant<unsigned int, 1U>) [with _UIntType=uint_fast32_t, __w=24UL, __s=10UL, __r=24UL]" at line 2576
Tests compile and pass if above __lce_ta is changed for 32bit case from unsigned to unsigned long.
Show
LIBCXX/libcxx/include/random shown below uses unsigned instead of unsigned long for the "32" bit case of __lce_ta:
// 32
template <unsigned long long _Ap, unsigned long long _Cp, unsigned long long _Mp>
struct __lce_ta<_Ap, _Cp, _Mp, (unsigned long)(~0), true>
{
typedef unsigned long result_type;
...
armcl/clang both compile with no errors.
msp430, however, has 16bit "unsigned" and fails with below error due to above issue where "unsigned" is used for 32 bit. It should use unsigned long instead:
"random", line 1890: error: incomplete type is not allowed
detected during:
instantiation of "std::__2::linear_congruential_engine<_UIntType, __a, __c, __m>::result_type std::__2::linear_congruential_engine<_UIntType, __a, __c, __m>::operator()() [with _UIntType=uint_fast32_t, __a=40014UL, __c=0UL, __m=2147483563UL]" at line 2651
instantiation of "void std::__2::subtract_with_carry_engine<_UIntType, __w, __s, __r>::seed(std::__2::subtract_with_carry_engine<_UIntType, __w, __s, __r>::result_type, std::__2::integral_constant<unsigned int, 1U>) [with _UIntType=uint_fast32_t, __w=24UL, __s=10UL, __r=24UL]" at line 2576
Tests compile and pass if above __lce_ta is changed for 32bit case from unsigned to unsigned long.