Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lltrunc, llround: truncation in implicit conversion #346

Closed
Kojoley opened this issue Apr 20, 2020 · 1 comment · Fixed by #968
Closed

lltrunc, llround: truncation in implicit conversion #346

Kojoley opened this issue Apr 20, 2020 · 1 comment · Fixed by #968

Comments

@Kojoley
Copy link
Contributor

Kojoley commented Apr 20, 2020

Running Spirit tests that use real_concept with clang-cl yields:

In file included from C:\projects\boost\libs\spirit\test\karma\real2.cpp:7:
In file included from C:\projects\boost\libs\spirit\test\karma/real.hpp:15:
In file included from .\boost/math/concepts/real_concept.hpp:28:
.\boost/math/special_functions/round.hpp(118,12): error: implicit conversion from 'long long' to 'long double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
   if((r > (std::numeric_limits<boost::long_long_type>::max)()) || (r < (std::numeric_limits<boost::long_long_type>::min)()))
         ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\boost/math/concepts/real_concept.hpp(297,23): note: in instantiation of function template specialization 'boost::math::llround<long double, boost::math::policies::policy<boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >' requested here
{ return boost::math::llround(v.value(), policies::policy<>()); }
                      ^
In file included from C:\projects\boost\libs\spirit\test\karma\real2.cpp:7:
In file included from C:\projects\boost\libs\spirit\test\karma/real.hpp:15:
In file included from .\boost/math/concepts/real_concept.hpp:29:
.\boost/math/special_functions/trunc.hpp(99,12): error: implicit conversion from 'long long' to 'long double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
   if((r > (std::numeric_limits<boost::long_long_type>::max)()) || (r < (std::numeric_limits<boost::long_long_type>::min)()))
         ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\boost/math/concepts/real_concept.hpp(316,23): note: in instantiation of function template specialization 'boost::math::lltrunc<long double, boost::math::policies::policy<boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy, boost::math::policies::default_policy> >' requested here
{ return boost::math::lltrunc(v.value(), policies::policy<>()); }
                      ^
@evanmiller
Copy link
Contributor

Possible duplicate of #430 and possibly fixed by #474

@mborland mborland linked a pull request Apr 3, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants