Skip to content

Update from C++17 to C++20 - #2772

Merged
sbc100 merged 1 commit into
mainfrom
cxx20
Jun 23, 2026
Merged

sbc100 merged 1 commit into
mainfrom
cxx20

Conversation

@sbc100

@sbc100 sbc100 commented Jun 23, 2026

Copy link
Copy Markdown
Member

Binaryen did this a while back in
WebAssembly/binaryen#8218.

There we a couple of issue related to building on macOS 13.2.1 but I don't think we need to support building on such old versions of macOS here. We still support deploying to macOS 10.14 via CMAKE_OSX_DEPLOYMENT_TARGET.

Use std::string::starts_with and std::string_view::starts_with in various places now that C++20 is available.

Also, adopt .contains() for std::map, std::set, and their unordered counterparts to replace verbose find/end and count checks.

@sbc100
sbc100 requested review from keithw and zherczeg June 23, 2026 07:09

@zherczeg zherczeg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.
We need to support old compilers, so maintenance will be a bit harder for us.

@sbc100
sbc100 force-pushed the cxx20 branch 5 times, most recently from 33329f0 to 6f985e4 Compare June 23, 2026 17:52
Binaryen did this a while back in
WebAssembly/binaryen#8218.

There we a couple of issue related to building on macOS 13.2.1 but
I don't think we need to support building on such old versions of
macOS here.  We still support deploying to macOS 10.14 via
CMAKE_OSX_DEPLOYMENT_TARGET.

Use std::string::starts_with and std::string_view::starts_with in
various places now that C++20 is available.

Also, adopt `.contains()` for std::map, std::set, and their unordered
counterparts to replace verbose find/end and count checks.
@sbc100
sbc100 merged commit deeb6f3 into main Jun 23, 2026
17 checks passed
@sbc100
sbc100 deleted the cxx20 branch June 23, 2026 18:24
DavidKorczynski pushed a commit to google/oss-fuzz that referenced this pull request Jun 23, 2026
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.

2 participants