1 ===========================================
2 Clang |release| |ReleaseNotesTitle|
3 ===========================================
9 Written by the `LLVM Team <https://llvm.org/>`_
14 These are in-progress notes for the upcoming Clang |version| release.
15 Release notes for previous releases can be found on
16 `the Download Page <https://releases.llvm.org/download.html>`_.
21 This document contains the release notes for the Clang C/C++/Objective-C
22 frontend, part of the LLVM Compiler Infrastructure, release |release|. Here we
23 describe the status of Clang in some detail, including major
24 improvements from the previous release and new feature work. For the
25 general LLVM release notes, see `the LLVM
26 documentation <https://llvm.org/docs/ReleaseNotes.html>`_. All LLVM
27 releases may be downloaded from the `LLVM releases web
28 site <https://llvm.org/releases/>`_.
30 For more information about Clang or LLVM, including information about the
31 latest release, please see the `Clang Web Site <https://clang.llvm.org>`_ or the
32 `LLVM Web Site <https://llvm.org>`_.
34 Note that if you are reading this file from a Git checkout or the
35 main Clang web page, this document applies to the *next* release, not
36 the current one. To see the release notes for a specific release, please
37 see the `releases page <https://llvm.org/releases/>`_.
39 Potentially Breaking Changes
40 ============================
41 These changes are ones which we think may surprise users when upgrading to
42 Clang |release| because of the opportunity they pose for disruption to existing
45 What's New in Clang |release|?
46 ==============================
47 Some of the major new features and improvements to Clang are listed
48 here. Generic improvements to Clang as a whole or to its underlying
49 infrastructure are described first, followed by language-specific
50 sections with improvements to Clang's support for those languages.
57 - Fix crash on invalid code when looking up a destructor in a templated class
58 inside a namespace. This fixes
59 `Issue 59446 <https://github.com/llvm/llvm-project/issues/59446>`_.
60 - Fix crash when diagnosing incorrect usage of ``_Nullable`` involving alias
62 `Issue 60344 <https://github.com/llvm/llvm-project/issues/60344>`_.
63 - Fix confusing warning message when ``/clang:-x`` is passed in ``clang-cl``
64 driver mode and emit an error which suggests using ``/TC`` or ``/TP``
65 ``clang-cl`` options instead. This fixes
66 `Issue 59307 <https://github.com/llvm/llvm-project/issues/59307>`_.
67 - Fix crash when evaluating consteval constructor of derived class whose base
68 has more than one field. This fixes
69 `Issue 60166 <https://github.com/llvm/llvm-project/issues/60166>`_.
71 Improvements to Clang's diagnostics
72 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
73 - We now generate a diagnostic for signed integer overflow due to unary minus
74 in a non-constant expression context. This fixes
75 `Issue 31643 <https://github.com/llvm/llvm-project/issues/31643>`_
76 - Clang now warns by default for C++20 and later about deprecated capture of
77 ``this`` with a capture default of ``=``. This warning can be disabled with
78 ``-Wno-deprecated-this-capture``.
80 Non-comprehensive list of changes in this release
81 -------------------------------------------------
82 - Clang now saves the address of ABI-indirect function parameters on the stack,
83 improving the debug information available in programs compiled without
85 - Clang now supports ``__builtin_nondeterministic_value`` that returns a
86 nondeterministic value of the same type as the provided argument.
91 Deprecated Compiler Flags
92 -------------------------
94 Modified Compiler Flags
95 -----------------------
97 Removed Compiler Flags
98 -------------------------
104 Attribute Changes in Clang
105 --------------------------
107 Introduced a new function attribute ``__attribute__((unsafe_buffer_usage))``
108 to be worn by functions containing buffer operations that could cause out of
109 bounds memory accesses. It emits warnings at call sites to such functions when
110 the flag ``-Wunsafe-buffer-usage`` is enabled.
112 ``__declspec`` attributes can now be used together with the using keyword. Before
113 the attributes on ``__declspec`` was ignored, while now it will be forwarded to the
114 point where the alias is used.
122 C Language Changes in Clang
123 ---------------------------
128 C++ Language Changes in Clang
129 -----------------------------
130 - Improved ``-O0`` code generation for calls to ``std::forward_like``. Similarly to
131 ``std::move, std::forward`` et al. it is now treated as a compiler builtin and implemented
132 directly rather than instantiating the definition from the standard library.
134 C++20 Feature Support
135 ^^^^^^^^^^^^^^^^^^^^^
137 C++2b Feature Support
138 ^^^^^^^^^^^^^^^^^^^^^
140 CUDA/HIP Language Changes in Clang
141 ----------------------------------
143 Objective-C Language Changes in Clang
144 -------------------------------------
146 OpenCL C Language Changes in Clang
147 ----------------------------------
154 OpenMP Support in Clang
155 -----------------------
159 CUDA Support in Clang
160 ---------------------
162 LoongArch Support in Clang
163 --------------------------
165 RISC-V Support in Clang
166 -----------------------
167 - Added ``-mrvv-vector-bits=`` option to give an upper and lower bound on vector
168 length. Valid values are powers of 2 between 64 and 65536. A value of 32
169 should eventually be supported. We also accept "zvl" to use the Zvl*b
170 extension from ``-march`` or ``-mcpu`` to the be the upper and lower bound.
175 WebAssembly Support in Clang
176 ----------------------------
178 DWARF Support in Clang
179 ----------------------
181 Arm and AArch64 Support in Clang
182 --------------------------------
184 * The hard-float ABI is now available in Armv8.1-M configurations that
185 have integer MVE instructions (and therefore have FP registers) but
186 no scalar or vector floating point computation. Previously, trying
187 to select the hard-float ABI on such a target (via
188 ``-mfloat-abi=hard`` or a triple ending in ``hf``) would silently
189 use the soft-float ABI instead.
191 Floating Point Support in Clang
192 -------------------------------
193 - Add ``__builtin_elementwise_log`` builtin for floating point types only.
194 - Add ``__builtin_elementwise_log10`` builtin for floating point types only.
195 - Add ``__builtin_elementwise_log2`` builtin for floating point types only.
209 - Add ``NextLineOnly`` style to option ``PackConstructorInitializers``.
210 Compared to ``NextLine`` style, ``NextLineOnly`` style will not try to
211 put the initializers on the current line first, instead, it will try to
212 put the initializers on the next line only.
220 - Introduced the new function ``clang_CXXMethod_isExplicit``,
221 which identifies whether a constructor or conversion function cursor
222 was marked with the explicit identifier.
227 .. _release-notes-sanitizers:
232 Core Analysis Improvements
233 ==========================
242 Python Binding Changes
243 ----------------------
245 The following methods have been added:
249 Significant Known Problems
250 ==========================
252 Additional Information
253 ======================
255 A wide variety of additional information is available on the `Clang web
256 page <https://clang.llvm.org/>`_. The web page contains versions of the
257 API documentation which are up-to-date with the Git version of
258 the source code. You can access versions of these documents specific to
259 this release by going into the "``clang/docs/``" directory in the Clang
262 If you have any questions or comments about Clang, please feel free to
263 contact us on the Discourse forums (Clang Frontend category)
264 <https://discourse.llvm.org/c/clang/6>`_.