What Causes This Issue
The C++26 disapproved error appears when Xcode’s Clang compiler rejects the -std=c++26 or -std=c++2b flag during build. This is a widespread reported issue among developers upgrading projects or experimenting with the latest C++ standard on Apple platforms. The root cause typically falls into one of three categories: an outdated Xcode version lacking C++26 support, incorrect project-level language dialect settings, or a mismatch between the active toolchain and the selected standard.
Apple’s Clang implementation tracks the C++ standard evolution closely, but support for C++26 (formerly C++2b) remains experimental and incomplete as of late 2026. Users in the Apple Support Community report seeing this error after updating Xcode, switching between command-line tools versions, or migrating projects from other platforms where C++26 support is further advanced. The error message typically reads: error: ‘c++26’ is not a supported value for -std or error: invalid value ‘c++2b’ for -std=.
Step-by-Step Fixes
- Verify Xcode version and update if needed
Open the App Store or Developer portal and confirm you are running Xcode 16.2 or later. C++26 support requires a recent Clang build (18+). Older Xcode releases only recognize up to c++23 or c++2a. - Check the active command-line tools version
Run xcode-select -p in Terminal to confirm the active developer directory. Then run clang –version to verify the Clang version. If it points to an older toolchain, switch with sudo xcode-select -s /Applications/Xcode.app. - Set the C++ Language Dialect in Project Build Settings
In Xcode, select your project target → Build Settings → search for C++ Language Dialect. Choose Compiler Default or explicitly select C++26 (-std=c++26) if available. If the dropdown only shows up to C++23, your toolchain does not yet support C++26. - Update the C++ Standard Library setting
In the same Build Settings pane, locate C++ Standard Library. Set it to libc++ (LLVM C++ standard library with C++26 support). Avoid libstdc++, which is deprecated and lacks modern standard support. - Clean build folder and delete derived data
Press Shift-Command-K to clean, then hold Option and choose Clean Build Folder. Remove ~/Library/Developer/Xcode/DerivedData for the project to clear cached module files that may reference the old dialect. - Test with a minimal C++26 feature
Add a test file using a confirmed C++26 feature (e.g., std::execution or std::mdspan if implemented). Build the target. If the error persists, the feature or dialect is not yet supported in your toolchain.
Additional Solutions
Use a nightly or custom Clang toolchain. Developers needing early C++26 features can install a nightly LLVM build via Homebrew (brew install llvm –head) and configure Xcode to use it via a custom toolchain file in ~/Library/Developer/Toolchains. This is unsupported by Apple and may introduce instability.
Downgrade the project dialect to C++23. If C++26 is not required, set the dialect to C++23 (-std=c++23) or C++20 for maximum compatibility. This resolves the error immediately and is the most reliable workaround for production projects.
Check for per-file compiler flags overriding the target setting. In Build Phases → Compile Sources, inspect individual files for custom flags like -std=c++2b. Remove or update them to match the target dialect.
Validate CMake or xcodebuild configurations. For projects using CMake, ensure set(CMAKE_CXX_STANDARD 26) is only used with a generator and toolchain that supports it. Add a version check: if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 18).
Monitor Apple’s Clang release notes. Each Xcode release includes a Clang Release Notes document listing supported C++26 features. Bookmark the page for your Xcode version to track when specific features land.
When to Contact Apple Support
Open a Feedback Assistant report (or a Technical Support Incident if you have an Apple Developer Program membership) when:
- You are on the latest non-beta Xcode and the C++ Language Dialect dropdown lists C++26 but the build still fails with disapproved.
- A documented C++26 feature from the Clang release notes triggers an internal compiler error (ICE) or silent miscompile.
- The error blocks adoption of a required SDK or framework that mandates C++26.
Include the full build log, Xcode version, clang –version output, and a minimal reproducer project. Apple’s compiler team prioritizes reports with isolated test cases.
FAQ
Does Xcode 16 fully support C++26? No. As of November 2026, Xcode 16.x provides partial, experimental C++26 support. The dialect flag may be accepted, but many library and language features remain unimplemented.
Why does the error say c++2b instead of c++26? C++2b was the working draft name for C++26. Older Clang versions only recognize c++2b; newer ones accept both. Use c++26 for forward compatibility.
Can I use C++26 with Swift Package Manager? Yes. In Package.swift, set .cxxLanguageStandard(.cxx26) on the target. Ensure the package is built with a compatible toolchain (Xcode 16.2+).
Will setting the dialect to C++26 break my existing C++20 code? Generally no. C++26 is designed to be backward compatible. However, a few removed or changed features (e.g., certain deprecated library components) may require code adjustments.
Is there a way to enable C++26 only for specific files? Yes. In Xcode, select the file in the Project Navigator → File Inspector → Target Membership → Compiler Flags, and add -std=c++26 per file. This is useful for incremental adoption.






































