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

Fix detection of ccmath usage in trunc #1044

Merged
merged 2 commits into from
Nov 3, 2023
Merged

Fix detection of ccmath usage in trunc #1044

merged 2 commits into from
Nov 3, 2023

Conversation

mborland
Copy link
Member

@mborland mborland commented Nov 3, 2023

As reported by @robertramey on the ML

@mborland
Copy link
Member Author

mborland commented Nov 3, 2023

Errored on clone in drone. Merging.

@mborland mborland merged commit 8435aef into develop Nov 3, 2023
58 checks passed
@mborland mborland deleted the next branch November 3, 2023 10:32
@jzmaddock
Copy link
Collaborator

@mborland sorry to be late to this, I don't think this quite gets it - for one thing we have the same logic in round.hpp which also needs fixing, but the problem is more subtle - we have modern clang sitting on top of an ancient (pre-C++17) std library, so from the compilers perspective, everything that we're currently checking here is supported (or potentially so) where as the std library's <type_traits> has no C++17 _v suffixed constants. Other than checking for a random C++17 header as a proxy in addition to the existing compiler checks I'm not sure what to suggest. In the long run we could yet another macro to Boost.Config I guess... ah wait, I think this is __cpp_lib_bool_constant >= 201505L? The latter requires inclusion of either type_traits or version, so the logic had probably better somewhere central.

I'll see if I can put together a patch shortly, might be too late for this release though as I can see quite a few headers getting touched.

@mborland
Copy link
Member Author

mborland commented Nov 3, 2023

I thought clang didn't get a version of __builtin_constant_evalutated until 9? If the type_traits had compiled the ccmath ldexp would have errored on initializing a constexpr variable with a non-constexpr expression since it uses the STL at runtime. Unless someone is running say Clang-10 with libstdc++-5 shouldn't properly checking for BOOST_MATH_NO_CONSTEXPR_DETECTION be sufficient? I think there's another week until RC release so you should have time.

@jzmaddock
Copy link
Collaborator

This is what I had in mind: #1045

And yes, from a practical point of view, you may be correct that no one would use clang-10 on top of gcc-5, though I'm constantly surprised by what what people do do!

@robertramey
Copy link
Member

FYI. It's not just mere "people". It's Boost Developers. Its from the test matrix which is our thing.

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 this pull request may close these issues.

3 participants