-
Notifications
You must be signed in to change notification settings - Fork 225
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 #include inside boost namespace #670
Conversation
The existing code fails to build if <utility> was not already included.
This needs to be fixed in a 1.76.1 release because it's currently totally broken with GCC trunk. I've refactored some libstdc++ headers so that the whole of |
The You could do: #ifdef __has_include
# if __has_include(<version>)
# include <version>
# define BOOST_MATH_HAVE_VERSION_HDR 1
#endif
#endif
#ifdef BOOST_MATH_HAVE_VERSION_HDR
# include <version>
#else
# include <utility>
#endif
....
#ifdef __cpp_lib_integer_sequence But frankly, you might as well just include |
I'm wondering how this managed to slip through CI testing as well. |
Possible scenarios:
Until last week, the third scenario wouldn't happen with libstdc++, because Presumably the third scenario also didn't happen with other implementations in your tests, although I suspect this would have triggered the bug using any impl: #include <version>
#include <boost/math/tools/mp.hpp> It certainly fails with old versions of libstdc++ and with a recent libc++. |
A workaround for this bug is to |
@jzmaddock Fortunately master for 1.77 is open until Wednesday so this fix is definitely worth cherry-picking. |
Test case is:
Note that if we replace |
Failing CI are server network issues, merging... |
math/include/boost/math/tools/mp.hpp Lines 356 to 357 in 3e46eba
and math/include/boost/math/tools/mp.hpp Lines 429 to 430 in 3e46eba
|
(N.B. there's an HTML escaping issue here) Right, but with GCC's current trunk it fails much more readily, because #include <boost/math/distributions/hypergeometric.hpp>
boost::math::hypergeometric_distribution dist(50, 50, 500); Admittedly GCC trunk isn't going to be released until Q2 2022, but it's likely to start appearing in distros sooner than that (maybe late 2021). |
You're correct - good catch, duplicate typedefs are allowed, but we shouldn't do that, will submit a fresh PR for that ASAP.
Nod. It's asking for trouble. |
See #671 |
- The existing code fails to build if <utility> was not already included. - boostorg/math#670
* Boost/1.76.0: Fix #include inside boost namespace patch - The existing code fails to build if <utility> was not already included. - boostorg/math#670 * Apply suggestions from code review Co-authored-by: Jordan Williams <jordan@jwillikers.com> --------- Co-authored-by: Chris Mc <prince.chrismc@gmail.com> Co-authored-by: Jordan Williams <jordan@jwillikers.com>
…/1.77.0) * Boost/1.76.0: Fix #include inside boost namespace patch - The existing code fails to build if <utility> was not already included. - boostorg/math#670 * Apply suggestions from code review Co-authored-by: Jordan Williams <jordan@jwillikers.com> --------- Co-authored-by: Chris Mc <prince.chrismc@gmail.com> Co-authored-by: Jordan Williams <jordan@jwillikers.com>
The existing code fails to build if was not already included.