Clang 23.0.0git (In-Progress) Release Notes¶
Written by the LLVM Team
Warning
These are in-progress notes for the upcoming Clang 23 release. Release notes for previous releases can be found on the Releases Page.
Introduction¶
This document contains the release notes for the Clang C/C++/Objective-C frontend, part of the LLVM Compiler Infrastructure, release 23.0.0git. Here we describe the status of Clang in some detail, including major improvements from the previous release and new feature work. For the general LLVM release notes, see the LLVM documentation. For the libc++ release notes, see this page. All LLVM releases may be downloaded from the LLVM releases web site.
For more information about Clang or LLVM, including information about the latest release, please see the Clang Web Site or the LLVM Web Site.
Potentially Breaking Changes¶
C/C++ Language Potentially Breaking Changes¶
C++ Specific Potentially Breaking Changes¶
ABI Changes in This Version¶
AST Dumping Potentially Breaking Changes¶
Clang Frontend Potentially Breaking Changes¶
Clang Python Bindings Potentially Breaking Changes¶
Remove
CompletionString.Availability. No libclang interfaces returned instances of it.CompletionString.availabilitynow returns instances ofCompletionString.AvailabilityKindCompat.Instances of
AvailabilityKindCompathave the same__str__representation as the previousCompletionChunk.Kindand are equality-comparable with the existingAvailabilityKindenum. It will be replaced byAvailabilityKindin a future release. When this happens, the return type ofCompletionString.availabilitywill change toAvailabilityKind, so it is recommended to useAvailabilityKindto compare with the return values ofCompletionString.availability.Remove
availabilityKinds. In this release, uses ofavailabilityKindsneed to be replaced byCompletionString.AvailabilityKind.CompletionChunk.kindnow returns instances ofCompletionChunkKind.Instances of
CompletionChunkKindhave the same__str__representation as the previousCompletionChunk.Kindfor compatibility. These representations will be changed in a future release to match other enums.Remove
completionChunkKindMap. In this release, uses ofcompletionChunkKindMapneed to be replaced byCompletionChunkKind.Move
SPELLING_CACHEintoCompletionChunkand change it to useCompletionChunkKindinstances as keys, instead of the enum values. An alias is kept in the form of aSPELLING_CACHEvariable, but it only supports__getitem__and__contains__. It will be removed in a future release. Please migrate to usingCompletionChunk.SPELLING_CACHEinstead.
What’s New in Clang 23.0.0git?¶
C++ Language Changes¶
C++2c Feature Support¶
C++23 Feature Support¶
C++20 Feature Support¶
C++17 Feature Support¶
Resolutions to C++ Defect Reports¶
C Language Changes¶
C2y Feature Support¶
C23 Feature Support¶
Non-comprehensive list of changes in this release¶
Added
__builtin_stdc_rotate_leftand__builtin_stdc_rotate_rightfor bit rotation of unsigned integers including_BitInttypes. Rotation counts are normalized modulo the bit-width and support negative values. Usable in constant expressions. Implicit conversion is supported for class/struct types with conversion operators.
New Compiler Flags¶
Deprecated Compiler Flags¶
Modified Compiler Flags¶
Removed Compiler Flags¶
Attribute Changes in Clang¶
Added new attribute
stack_protector_ignoreto opt specific local variables out of the analysis which determines if a function should get a stack protector. A function will still generate a stack protector if other local variables or command line flags require it.
Improvements to Clang’s diagnostics¶
Added
-Wlifetime-safetyto enable lifetime safety analysis, a CFG-based intra-procedural analysis that detects use-after-free and related temporal safety bugs. See the RFC for more details. By design, this warning is enabled in-Weverything. To disable the analysis, use-Wno-lifetime-safetyor-fno-lifetime-safety.Added
-Wlifetime-safety-suggestionsto enable lifetime annotation suggestions. This provides suggestions for function parameters that should be marked[[clang::lifetimebound]]based on lifetime analysis. For example, for the following function:int* p(int *in) { return in; }
Clang will suggest:
warning: parameter in intra-TU function should be marked [[clang::lifetimebound]] int* p(int *in) { return in; } ^~~~~~~ [[clang::lifetimebound]] note: param returned here int* p(int *in) { return in; } ^~
Added
-Wlifetime-safety-noescapeto detect misuse of[[clang::noescape]]annotation where the parameter escapes through return. For example:int* p(int *in [[clang::noescape]]) { return in; }
Clang will warn:
warning: parameter is marked [[clang::noescape]] but escapes int* p(int *in [[clang::noescape]]) { return in; } ^~~~~~~ note: returned here int* p(int *in [[clang::noescape]]) { return in; } ^~
Added
-Wlifetime-safety-dangling-fieldto detect dangling field references when stack memory escapes to class fields. This is part of-Wlifetime-safetyand detects cases where local variables or parameters are stored in fields but outlive their scope. For example:struct DanglingView { std::string_view view; DanglingView(std::string s) : view(s) {} // warning: address of stack memory escapes to a field };
Improvements to Clang’s time-trace¶
Improvements to Coverage Mapping¶
Bug Fixes in This Version¶
Fixed a failed assertion in the preprocessor when
__has_embedparameters are missing parentheses. (#175088)Fix lifetime extension of temporaries in for-range-initializers in templates. (#165182)
Fixed a preprocessor crash in
__has_cpp_attributeon incomplete scoped attributes. (#178098)
Bug Fixes to Compiler Builtins¶
Bug Fixes to Attribute Support¶
Fixed a behavioral discrepancy between deleted functions and private members when checking the
enable_ifattribute. (#175895)
Bug Fixes to C++ Support¶
Fixed a crash when instantiating
requiresexpressions involving substitution failures in C++ concepts. (#176402)
Bug Fixes to AST Handling¶
Miscellaneous Bug Fixes¶
Miscellaneous Clang Crashes Fixed¶
Fixed a crash when attempting to jump over initialization of a variable with variably modified type. (#175540)
Fixed a crash when using loop hint with a value dependent argument inside a generic lambda. (#172289)
Fixed a crash in C++ overload resolution with
_Atomic-qualified argument types. (#170433)
OpenACC Specific Changes¶
Target Specific Changes¶
AMDGPU Support¶
Initial support for gfx1310
NVPTX Support¶
X86 Support¶
Arm and AArch64 Support¶
Android Support¶
Windows Support¶
LoongArch Support¶
DWARF fission is now compatible with linker relaxations, allowing -gsplit-dwarf and -mrelax to be used together when building for the LoongArch platform.
RISC-V Support¶
Tenstorrent Ascalon D8 was renamed to Ascalon X. Use tt-ascalon-x with -mcpu or -mtune.
CUDA/HIP Language Changes¶
CUDA Support¶
AIX Support¶
NetBSD Support¶
WebAssembly Support¶
Fixed a crash when
__funcrefis applied to a non-function pointer type. (#118233)
AVR Support¶
SystemZ Support¶
Add support for #pragma export for z/OS. This is a pragma used to export functions and variables with external linkage from shared libraries. It provides compatibility with the IBM XL C/C++ compiler.
DWARF Support in Clang¶
Floating Point Support in Clang¶
Fixed Point Support in Clang¶
AST Matchers¶
Add
functionTypeLocmatcher for matchingFunctionTypeLoc.
clang-format¶
Add
ObjCSpaceAfterMethodDeclarationPrefixoption to control space between the ‘-‘/’+’ and the return type in Objective-C method declarations
libclang¶
Code Completion¶
Static Analyzer¶
Sanitizers¶
Python Binding Changes¶
Add deprecation warnings to
CompletionChunk.isKind...methods. These will be removed in a future release. Existing uses should be adapted to directly compare equality of theCompletionChunkkind with the correspondingCompletionChunkKindvariant.Affected methods:
isKindOptional,isKindTypedText,isKindPlaceHolder,isKindInformativeandisKindResultType.
OpenMP Support¶
Added support for
transparentclause in task and taskloop directives.Added support for
use_device_ptrclause to accept an optionalfallbackmodifier (fb_nullifyorfb_preserve) with OpenMP >= 61.
Improvements¶
Additional Information¶
A wide variety of additional information is available on the Clang web
page. The web page contains versions of the
API documentation which are up-to-date with the Git version of
the source code. You can access versions of these documents specific to
this release by going into the “clang/docs/” directory in the Clang
tree.
If you have any questions or comments about Clang, please feel free to contact us on the Discourse forums (Clang Frontend category).