Clang 20.0.0git (In-Progress) Release Notes¶
Written by the LLVM Team
Warning
These are in-progress notes for the upcoming Clang 20 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 20.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¶
These changes are ones which we think may surprise users when upgrading to Clang 20.0.0git because of the opportunity they pose for disruption to existing code bases.
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¶
What’s New in Clang 20.0.0git?¶
Some of the major new features and improvements to Clang are listed here. Generic improvements to Clang as a whole or to its underlying infrastructure are described first, followed by language-specific sections with improvements to Clang’s support for those languages.
C++ Language Changes¶
C++17 Feature Support¶
C++14 Feature Support¶
C++20 Feature Support¶
C++23 Feature Support¶
Removed the restriction to literal types in constexpr functions in C++23 mode.
C++2c Feature Support¶
Add
__builtin_is_virtual_base_of
intrinsic, which supports P2985R0 A type trait for detecting virtual base classes
Resolutions to C++ Defect Reports¶
C Language Changes¶
C2y Feature Support¶
C23 Feature Support¶
New Compiler Flags¶
Deprecated Compiler Flags¶
Modified Compiler Flags¶
Removed Compiler Flags¶
Attribute Changes in Clang¶
Clang now disallows more than one
__attribute__((ownership_returns(class, idx)))
with different class names attached to one function.Introduced a new format attribute
__attribute__((format(syslog, 1, 2)))
from OpenBSD.
Improvements to Clang’s diagnostics¶
Some template related diagnostics have been improved.
void foo() { template <typename> int i; } // error: templates can only be declared in namespace or class scope struct S { template <typename> int i; // error: non-static data member 'i' cannot be declared as a template };
Clang now diagnoses dangling references to fields of temporary objects. Fixes #81589.
Clang now diagnoses undefined behavior in constant expressions more consistently. This includes invalid shifts, and signed overflow in arithmetic.
-Wdangling-assignment-gsl is enabled by default.
Improvements to Clang’s time-trace¶
Improvements to Coverage Mapping¶
Bug Fixes in This Version¶
Fixed the definition of
ATOMIC_FLAG_INIT
in<stdatomic.h>
so it can be used in C++.
Bug Fixes to Compiler Builtins¶
Bug Fixes to Attribute Support¶
Bug Fixes to C++ Support¶
Bug Fixes to AST Handling¶
Miscellaneous Bug Fixes¶
Miscellaneous Clang Crashes Fixed¶
Fixed a crash in C due to incorrect lookup that members in nested anonymous struct/union can be found as ordinary identifiers in struct/union definition. (#31295)
OpenACC Specific Changes¶
Target Specific Changes¶
AMDGPU Support¶
X86 Support¶
The MMX vector intrinsic functions from
*mmintrin.h
which operate on __m64 vectors, such as_mm_add_pi8
, have been reimplemented to use the SSE2 instruction-set and XMM registers unconditionally. These intrinsics are therefore no longer supported if MMX is enabled without SSE2 – either from targeting CPUs from the Pentium-MMX through the Pentium 3, or explicitly via passing arguments such as-mmmx -mno-sse2
. MMX assembly code remains supported without requiring SSE2, including inside inline-assembly.The compiler builtins such as
__builtin_ia32_paddb
which formerly implemented the above MMX intrinsic functions have been removed. Any uses of these removed functions should migrate to the functions defined by the*mmintrin.h
headers. A mapping can be found in the fileclang/www/builtins.py
.
Arm and AArch64 Support¶
Android Support¶
Windows Support¶
LoongArch Support¶
RISC-V Support¶
CUDA/HIP Language Changes¶
CUDA Support¶
AIX Support¶
NetBSD Support¶
WebAssembly Support¶
AVR Support¶
DWARF Support in Clang¶
Floating Point Support in Clang¶
Fixed Point Support in Clang¶
AST Matchers¶
clang-format¶
libclang¶
Static Analyzer¶
New features¶
MallocChecker now checks for
ownership_returns(class, idx)
andownership_takes(class, idx)
attributes with class names different from “malloc”. Clang static analyzer now reports an error if class of allocation and deallocation function mismatches. Documentation.
Crash and bug fixes¶
Improvements¶
Moved checkers¶
Sanitizers¶
Python Binding Changes¶
OpenMP Support¶
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).