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 error when compiling with -std=c++20 #1083

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

nilsfriess
Copy link
Collaborator

While trying to fix the constexpr half problems I tried compiling the project with -std=c++20. Almost everything compiled expect for a function call to std::inserter in the cbs part: In C++20 the signature of std::inserter changed and the container that is used with std::inserter now requires a begin method (because the second argument of std::inserter now is of type std::ranges::iterator_t which is essentially defined as the type of ranges::begin(Container)). So I just added a begin function to the type it complains about (and since this type is just a wrapper for llvm::SmallPtrSet, I can just call begin of llvm::SmallPtrSet).

…inserter`

In C++20 the signature of `std::inserter` changed and compiling with
`-std=c++20` caused an error in `SubCfgFormation.cpp:1023`
Copy link
Collaborator

@illuhad illuhad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@illuhad
Copy link
Collaborator

illuhad commented Jul 17, 2023

What is the relation between constexpr half and compiling our compiler components with -std=c++20?

@illuhad illuhad merged commit 6437639 into AdaptiveCpp:develop Jul 17, 2023
17 checks passed
@nilsfriess
Copy link
Collaborator Author

What is the relation between constexpr half and compiling our compiler components with -std=c++20?

Maybe I formulated it a bit confusing: I was trying to compile the project with C++20 to check if my changes to the half class (containing feature test macros to detect bit_cast capabilities) work. During compilation, I got the error explained above. So I just extracted the fix for this error as a separate PR, it has absolutely nothing to do with the half class :)

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.

None yet

2 participants