Skip to content

Conversation

@spholz
Copy link
Member

@spholz spholz commented Dec 29, 2025

Now that OSS-Fuzz is on LLVM 22 and the newest Apple Clang version accepts -std=c++26, we can set our CMAKE_CXX_STANDARD to C++26 and start using some of the fancy new features.

@spholz spholz requested a review from timschumi as a code owner December 29, 2025 21:27
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label Dec 29, 2025
@spholz spholz force-pushed the c++26 branch 2 times, most recently from d15644c to d00e1bf Compare December 29, 2025 23:44
set(CMAKE_CXX_STANDARD 23)

# FIXME: Remove this once CMake knows that AppleClang understands -std=c++26.
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
Copy link
Contributor

@nico nico Dec 30, 2025

Choose a reason for hiding this comment

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

Per Discord, this might work:

# FIXME: Remove this once CMake knows that AppleClang understands -std=c++26,
# see https://gitlab.kitware.com/cmake/cmake/-/issues/27486
if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
    set(CMAKE_CXX_STANDARD 23)
    set(CMAKE_CXX23_STANDARD_COMPILE_OPTION "")
    set(CMAKE_CXX_FLAGS "-std=c++26")
else()
    set(CMAKE_CXX_STANDARD 26)
endif()

@spholz spholz force-pushed the c++26 branch 2 times, most recently from 2805a57 to 40deb02 Compare December 30, 2025 11:49
nico added 4 commits January 1, 2026 20:05
main.mm used to not do this as it didn't include AK headers.
We're about to put another workaround in CocoaWrapper.h that's
needed here too though.

No behavior change.
QD/ColorSyncDeprecated.h, normally pulled in by Cocoa.h, contains
many enums triggering

    "invalid arithmetic between different enumeration types"

in C++26. Omit it from the build by hackily defining its include
guard macro.
Carbon.h also pulls in QD/ColorSyncDeprecated.h, and other than
in the previous commit we can't just hack it out, since that breaks
other things in Carbon.h.

But we only need Carbon.h for two enums in HIToolbox/Events.h, so
locally define those enums directly.

No behavior change.
if: ${{ inputs.os == 'macOS' }}
shell: bash
run: |
sudo xcode-select -s /Applications/Xcode_26.1.app/Contents/Developer
Copy link
Member

Choose a reason for hiding this comment

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

previously (and in ladybird) we've used this action to do this: https://github.com/maxim-lobanov/setup-xcode.

No real impact to use the manual way vs an action, other than a slightly 'prettier' yaml. though now that ladybird uses custom runners and blacksmith, idk if that action is still used :thonk:

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I'd rather use a simple one-liner here than depending on some external action.

spholz added 5 commits January 3, 2026 12:11
This will be necessary for moving to C++26.
This will be necessary for moving to C++26.
This will be necessary for moving to C++26.
Building OSS-Fuzz locally showed that this workaround doesn't seem to
be necessary anymore.
@spholz spholz merged commit 44a54aa into SerenityOS:master Jan 4, 2026
14 checks passed
@spholz spholz deleted the c++26 branch January 4, 2026 12:47
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label Jan 4, 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.

3 participants