Skip to content

Commit

Permalink
Fixes for compile tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mborland committed May 6, 2021
1 parent 0cd6039 commit 16c57be
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class septic_hermite_detail {
return dydx;
}

inline Real double_prime(Real x) const
inline Real double_prime(Real) const
{
return std::numeric_limits<Real>::quiet_NaN();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ namespace boost {
switch(peek_char(it, end, ct)) {
case 'q':
case 's':
if(flags_ && legacy)
if(flags_)
++it;
break; // "nanq", "nans"

Expand Down
2 changes: 1 addition & 1 deletion include/boost/math/special_functions/rsqrt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ template<typename Real>
inline Real rsqrt(Real const & x)
{
using std::sqrt;
if constexpr (std::is_same_v<Real, float> || std::is_same_v<Real, double> || std::is_same_v<Real, long double>)
if constexpr (std::is_floating_point_v<Real>)
{
return 1/sqrt(x);
}
Expand Down
2 changes: 1 addition & 1 deletion include/boost/math/statistics/detail/single_pass.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ ReturnType gini_range_fraction(ForwardIterator first, ForwardIterator last, std:
}

template<typename ReturnType, typename ExecutionPolicy, typename ForwardIterator>
ReturnType gini_coefficient_parallel_impl(ExecutionPolicy&& exec, ForwardIterator first, ForwardIterator last)
ReturnType gini_coefficient_parallel_impl(ExecutionPolicy&&, ForwardIterator first, ForwardIterator last)
{
using range_tuple = std::tuple<ReturnType, ReturnType, std::size_t>;

Expand Down
1 change: 1 addition & 0 deletions include/boost/math/tools/convert_from_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace boost{ namespace math{ namespace tools{
#ifdef BOOST_MATH_NO_LEXICAL_CAST
// This function should not compile, we don't have the necessary functionality to support it:
static_assert(sizeof(Real) == 0, "boost.lexical_cast is not supported in standalone mode.");
(void)p; // Supresses -Wunused-parameter
return Real(0);
#else
return boost::lexical_cast<Real>(p);
Expand Down
136 changes: 68 additions & 68 deletions test/compile_test/cstdfloat_cmath_incl_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,75 +18,75 @@ void compile_and_link_test()
#ifdef BOOST_FLOAT128_C
boost::float128_t f128 = 0;

check_result<boost::float128_t>(ldexp(f128, 0));
check_result<boost::float128_t>(frexp(f128, 0));
check_result<boost::float128_t>(std::ldexp(f128, 0));
check_result<boost::float128_t>(std::frexp(f128, 0));
check_result<boost::float128_t>(std::fabs(f128));
check_result<boost::float128_t>(std::abs(f128));
check_result<boost::float128_t>(floor(f128));
check_result<boost::float128_t>(ceil(f128));
check_result<boost::float128_t>(sqrt(f128));
check_result<boost::float128_t>(trunc(f128));
check_result<boost::float128_t>(exp(f128));
check_result<boost::float128_t>(expm1(f128));
check_result<boost::float128_t>(pow(f128, 0));
check_result<boost::float128_t>(log(f128));
check_result<boost::float128_t>(log10(f128));
check_result<boost::float128_t>(sin(f128));
check_result<boost::float128_t>(cos(f128));
check_result<boost::float128_t>(tan(f128));
check_result<boost::float128_t>(asin(f128));
check_result<boost::float128_t>(acos(f128));
check_result<boost::float128_t>(atan(f128));
check_result<boost::float128_t>(sinh(f128));
check_result<boost::float128_t>(cosh(f128));
check_result<boost::float128_t>(tanh(f128));
check_result<boost::float128_t>(asinh(f128));
check_result<boost::float128_t>(acosh(f128));
check_result<boost::float128_t>(atanh(f128));
check_result<boost::float128_t>(fmod(f128, f128));
check_result<boost::float128_t>(atan2(f128, f128));
check_result<boost::float128_t>(lgamma(f128));
check_result<boost::float128_t>(tgamma(f128));
check_result<boost::float128_t>(remainder(f128, f128));
check_result<boost::float128_t>(remquo(f128, f128, 0));
check_result<boost::float128_t>(fma(f128, f128, f128));
check_result<boost::float128_t>(fmax(f128, f128));
check_result<boost::float128_t>(fmin(f128, f128));
check_result<boost::float128_t>(fdim(f128, f128));
check_result<boost::float128_t>(nanq(0));
check_result<boost::float128_t>(exp2(f128));
check_result<boost::float128_t>(log2(f128));
check_result<boost::float128_t>(log1p(f128));
check_result<boost::float128_t>(cbrt(f128));
check_result<boost::float128_t>(hypot(f128, f128));
check_result<boost::float128_t>(erf(f128));
check_result<boost::float128_t>(erfc(f128));
check_result<boost::float128_t>(llround(f128));
check_result<boost::float128_t>(lround(f128));
check_result<boost::float128_t>(round(f128));
check_result<boost::float128_t>(nearbyint(f128));
check_result<boost::float128_t>(llrint(f128));
check_result<boost::float128_t>(lrint(f128));
check_result<boost::float128_t>(rint(f128));
check_result<boost::float128_t>(modf(f128, nullptr));
check_result<boost::float128_t>(scalbln(f128, 0));
check_result<boost::float128_t>(scalbn(f128, 0));
check_result<boost::float128_t>(ilogb(f128));
check_result<boost::float128_t>(logb(f128));
check_result<boost::float128_t>(nextafter(f128, f128));
check_result<boost::float128_t>(nexttoward(f128, f128));
check_result<boost::float128_t>(copysign(f128, f128));
check_result<boost::float128_t>(std::signbit(f128));
check_result<boost::float128_t>(std::fpclassify(f128));
check_result<boost::float128_t>(std::isfinite(f128));
check_result<boost::float128_t>(std::isinf(f128));
check_result<boost::float128_t>(std::isnan(f128));
check_result<boost::float128_t>(std::isnormal(f128));
check_result<boost::float128_t>(std::isgreater(f128, f128));
check_result<boost::float128_t>(std::isgreaterequal(f128, f128));
check_result<boost::float128_t>(std::isless(f128, f128));
check_result<boost::float128_t>(std::islessequal(f128, f128));
check_result<boost::float128_t>(std::islessgreater(f128, f128));
check_result<boost::float128_t>(std::isunordered(f128, f128));
check_result<boost::float128_t>(std::floor(f128));
check_result<boost::float128_t>(std::ceil(f128));
check_result<boost::float128_t>(std::sqrt(f128));
check_result<boost::float128_t>(std::trunc(f128));
check_result<boost::float128_t>(std::exp(f128));
check_result<boost::float128_t>(std::expm1(f128));
check_result<boost::float128_t>(std::pow(f128, 0));
check_result<boost::float128_t>(std::log(f128));
check_result<boost::float128_t>(std::log10(f128));
check_result<boost::float128_t>(std::sin(f128));
check_result<boost::float128_t>(std::cos(f128));
check_result<boost::float128_t>(std::tan(f128));
check_result<boost::float128_t>(std::asin(f128));
check_result<boost::float128_t>(std::acos(f128));
check_result<boost::float128_t>(std::atan(f128));
check_result<boost::float128_t>(std::sinh(f128));
check_result<boost::float128_t>(std::cosh(f128));
check_result<boost::float128_t>(std::tanh(f128));
check_result<boost::float128_t>(std::asinh(f128));
check_result<boost::float128_t>(std::acosh(f128));
check_result<boost::float128_t>(std::atanh(f128));
check_result<boost::float128_t>(std::fmod(f128, f128));
check_result<boost::float128_t>(std::atan2(f128, f128));
check_result<boost::float128_t>(std::lgamma(f128));
check_result<boost::float128_t>(std::tgamma(f128));
check_result<boost::float128_t>(std::remainder(f128, f128));
check_result<boost::float128_t>(std::remquo(f128, f128, 0));
check_result<boost::float128_t>(std::fma(f128, f128, f128));
check_result<boost::float128_t>(std::fmax(f128, f128));
check_result<boost::float128_t>(std::fmin(f128, f128));
check_result<boost::float128_t>(std::fdim(f128, f128));
check_result<boost::float128_t>(std::nanq(0));
check_result<boost::float128_t>(std::exp2(f128));
check_result<boost::float128_t>(std::log2(f128));
check_result<boost::float128_t>(std::log1p(f128));
check_result<boost::float128_t>(std::cbrt(f128));
check_result<boost::float128_t>(std::hypot(f128, f128));
check_result<boost::float128_t>(std::erf(f128));
check_result<boost::float128_t>(std::erfc(f128));
check_result<long long>(std::llround(f128));
check_result<long>(std::lround(f128));
check_result<boost::float128_t>(std::round(f128));
check_result<boost::float128_t>(std::nearbyint(f128));
check_result<long long>(std::llrint(f128));
check_result<long>(std::lrint(f128));
check_result<boost::float128_t>(std::rint(f128));
check_result<boost::float128_t>(std::modf(f128, nullptr));
check_result<boost::float128_t>(std::scalbln(f128, 0));
check_result<boost::float128_t>(std::scalbn(f128, 0));
check_result<int>(std::ilogb(f128));
check_result<boost::float128_t>(std::logb(f128));
check_result<boost::float128_t>(std::nextafter(f128, f128));
check_result<boost::float128_t>(std::nexttoward(f128, f128));
check_result<boost::float128_t>(std::copysign(f128, f128));
check_result<bool>(std::signbit(f128));
check_result<int>(std::fpclassify(f128));
check_result<bool>(std::isfinite(f128));
check_result<bool>(std::isinf(f128));
check_result<bool>(std::isnan(f128));
check_result<bool>(std::isnormal(f128));
check_result<bool>(std::isgreater(f128, f128));
check_result<bool>(std::isgreaterequal(f128, f128));
check_result<bool>(std::isless(f128, f128));
check_result<bool>(std::islessequal(f128, f128));
check_result<bool>(std::islessgreater(f128, f128));
check_result<bool>(std::isunordered(f128, f128));
#endif // boost::float128_t
}
2 changes: 1 addition & 1 deletion test/compile_test/quad_naive_monte_carlo_concept_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ using boost::math::quadrature::naive_monte_carlo;

void compile_and_link_test()
{
auto g = [&](std::vector<std_real_concept> const & x)
auto g = [&](std::vector<std_real_concept> const &)
{
return 1.873;
};
Expand Down
4 changes: 2 additions & 2 deletions test/compile_test/quad_ooura_fourier_integrals_incl_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void compile_and_link_test()
auto f = [](double x) { return x; };
boost::math::quadrature::ooura_fourier_sin<double> sin_integrator;
boost::math::quadrature::ooura_fourier_cos<double> cos_integrator;
check_result<double>(sin_integrator.integrate(f, 1.0));
check_result<double>(cos_integrator.integrate(f, 1.0));
check_result<std::pair<double, double>>(sin_integrator.integrate(f, 1.0));
check_result<std::pair<double, double>>(cos_integrator.integrate(f, 1.0));
}
#endif
6 changes: 3 additions & 3 deletions test/compile_test/sf_rsqrt_incl_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

void compile_and_link_test()
{
check_result<int>(boost::math::rsqrt<float>(f));
check_result<int>(boost::math::rsqrt<double>(d));
check_result<float>(boost::math::rsqrt<float>(f));
check_result<double>(boost::math::rsqrt<double>(d));
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
check_result<int>(boost::math::rsqrt<long double>(l));
check_result<long double>(boost::math::rsqrt<long double>(l));
#endif
}
2 changes: 1 addition & 1 deletion test/compile_test/test_compile_result.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ inline void check_result_imp(bool, bool){}
//
// If the compiler warns about unused typedefs then enable this:
//
#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)))
#if (defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)))) || (defined(__clang__) && __clang_major__ > 4)
# define BOOST_MATH_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))
#else
# define BOOST_MATH_ASSERT_UNUSED_ATTRIBUTE
Expand Down

0 comments on commit 16c57be

Please sign in to comment.