Skip to content

Conversation

ecatmur
Copy link
Contributor

@ecatmur ecatmur commented Nov 24, 2023

Trying to form next/prior in constant evaluation may be ill-formed. Fixes #69.

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

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.

Copy link
Contributor Author

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) ;)

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 :)

https://github.com/llvm/llvm-project/pull/67528/files#diff-24549b124046a492279fe53ffe2aca86550f281b025a48067c043a1c944547faR3

Apply change since C++11
@ecatmur ecatmur changed the title Use static const for next/prior from C++17 Use static const for next/prior from C++11 Nov 27, 2023
@pdimov pdimov closed this Jun 17, 2024
@pdimov pdimov reopened this Jun 17, 2024
@pdimov pdimov merged commit b37b709 into boostorg:develop Jun 18, 2024
ktrushin pushed a commit to percona/percona-server-mongodb that referenced this pull request Nov 2, 2024
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
ktrushin pushed a commit to percona/percona-server-mongodb that referenced this pull request Nov 4, 2024
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
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.

boost::mpl::integral_c broken in Clang trunk
3 participants