-
Notifications
You must be signed in to change notification settings - Fork 81
Use static const for next/prior from C++11 #77
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
Conversation
Trying to form next/prior in constant evaluation may be ill-formed; see boostorg#69
@@ -56,7 +56,8 @@ struct AUX_WRAPPER_NAME | |||
// have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC), | |||
// while some other don't like 'value + 1' (Borland), and some don't like | |||
// either | |||
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) | |||
#if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) \ | |||
|| __cplusplus >= 201703L |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the warning is active from C++11 and onwards.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed, thanks. I was following someone's comment here llvm/llvm-project#50055 (comment) ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, technically this has moved from "unspecified behavior" in <=C++14 to "undefined behavior" in C++17 onwards. But the LLVM implementation warns starting on C++11. Not sure what the correct behavior would be (is there any?), but that's how it works today :)
Apply change since C++11
Trying to form next/prior in constant evaluation may be ill-formed; see boostorg/mpl#69 Note: the patch source is boostorg/mpl#77 Please also see boostorg/mpl#69
Trying to form next/prior in constant evaluation may be ill-formed; see boostorg/mpl#69 Note: the patch source is boostorg/mpl#77 Please also see boostorg/mpl#69
Trying to form next/prior in constant evaluation may be ill-formed. Fixes #69.