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 Releases Page <https://llvm.org/releases/>`_.
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>`_. For the libc++ release notes,
27 see `this page <https://libcxx.llvm.org/ReleaseNotes.html>`_. All LLVM releases
28 may be downloaded from the `LLVM releases web 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 Potentially Breaking Changes
35 ============================
36 These changes are ones which we think may surprise users when upgrading to
37 Clang |release| because of the opportunity they pose for disruption to existing
41 C/C++ Language Potentially Breaking Changes
42 -------------------------------------------
44 - The default extension name for PCH generation (``-c -xc-header`` and ``-c
45 -xc++-header``) is now ``.pch`` instead of ``.gch``.
46 - ``-include a.h`` probing ``a.h.gch`` is deprecated. Change the extension name
47 to ``.pch`` or use ``-include-pch a.h.gch``.
48 - Fixed a bug that caused ``__has_cpp_attribute`` and ``__has_c_attribute``
49 return incorrect values for some C++-11-style attributes. Below is a complete
50 list of behavior changes.
53 :header: Test, Old value, New value
55 ``__has_cpp_attribute(unused)``, 201603, 0
56 ``__has_cpp_attribute(gnu::unused)``, 201603, 1
57 ``__has_c_attribute(unused)``, 202106, 0
58 ``__has_cpp_attribute(clang::fallthrough)``, 201603, 1
59 ``__has_cpp_attribute(gnu::fallthrough)``, 201603, 1
60 ``__has_c_attribute(gnu::fallthrough)``, 201910, 1
61 ``__has_cpp_attribute(warn_unused_result)``, 201907, 0
62 ``__has_cpp_attribute(clang::warn_unused_result)``, 201907, 1
63 ``__has_cpp_attribute(gnu::warn_unused_result)``, 201907, 1
64 ``__has_c_attribute(warn_unused_result)``, 202003, 0
65 ``__has_c_attribute(gnu::warn_unused_result)``, 202003, 1
67 C++ Specific Potentially Breaking Changes
68 -----------------------------------------
69 - The name mangling rules for function templates has been changed to take into
70 account the possibility that functions could be overloaded on their template
71 parameter lists or requires-clauses. This causes mangled names to change for
72 function templates in the following cases:
74 - When a template parameter in a function template depends on a previous
75 template parameter, such as ``template<typename T, T V> void f()``.
76 - When the function has any constraints, whether from constrained template
77 parameters or requires-clauses.
78 - When the template parameter list includes a deduced type -- either
79 ``auto``, ``decltype(auto)``, or a deduced class template specialization
81 - When a template template parameter is given a template template argument
82 that has a different template parameter list.
84 This fixes a number of issues where valid programs would be rejected due to
85 mangling collisions, or would in some cases be silently miscompiled. Clang
86 will use the old manglings if ``-fclang-abi-compat=17`` or lower is
88 (`#48216 <https://github.com/llvm/llvm-project/issues/48216>`_),
89 (`#49884 <https://github.com/llvm/llvm-project/issues/49884>`_), and
90 (`#61273 <https://github.com/llvm/llvm-project/issues/61273>`_)
92 - The `ClassScopeFunctionSpecializationDecl` AST node has been removed.
93 Dependent class scope explicit function template specializations now use
94 `DependentFunctionTemplateSpecializationInfo` to store candidate primary
95 templates and explicit template arguments. This should not impact users of
96 Clang as a compiler, but it may break assumptions in Clang-based tools
97 iterating over the AST.
99 ABI Changes in This Version
100 ---------------------------
101 - Following the SystemV ABI for x86-64, ``__int128`` arguments will no longer
102 be split between a register and a stack slot.
104 What's New in Clang |release|?
105 ==============================
106 Some of the major new features and improvements to Clang are listed
107 here. Generic improvements to Clang as a whole or to its underlying
108 infrastructure are described first, followed by language-specific
109 sections with improvements to Clang's support for those languages.
114 C++20 Feature Support
115 ^^^^^^^^^^^^^^^^^^^^^
117 C++23 Feature Support
118 ^^^^^^^^^^^^^^^^^^^^^
119 - Implemented `P0847R7: Deducing this <https://wg21.link/P0847R7>`_. Some related core issues were also
120 implemented (`CWG2553 <https://wg21.link/CWG2553>`_, `CWG2554 <https://wg21.link/CWG2554>`_,
121 `CWG2653 <https://wg21.link/CWG2653>`_, `CWG2687 <https://wg21.link/CWG2687>`_). Because the
122 support for this feature is still experimental, the feature test macro ``__cpp_explicit_this_parameter``
123 was not set in this version.
125 C++2c Feature Support
126 ^^^^^^^^^^^^^^^^^^^^^
128 - Implemented `P2169R4: A nice placeholder with no name <https://wg21.link/P2169R4>`_. This allows using ``_``
129 as a variable name multiple times in the same scope and is supported in all C++ language modes as an extension.
130 An extension warning is produced when multiple variables are introduced by ``_`` in the same scope.
131 Unused warnings are no longer produced for variables named ``_``.
132 Currently, inspecting placeholders variables in a debugger when more than one are declared in the same scope
138 int _, _; // Was invalid, now OK
141 int _, _; // Was invalid, now OK
144 int _; // Previously diagnosed under -Wunused, no longer diagnosed
147 - Attributes now expect unevaluated strings in attributes parameters that are string literals.
148 This is applied to both C++ standard attributes, and other attributes supported by Clang.
149 This completes the implementation of `P2361R6 Unevaluated Strings <https://wg21.link/P2361R6>`_
152 Resolutions to C++ Defect Reports
153 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
157 - ``structs``, ``unions``, and ``arrays`` that are const may now be used as
158 constant expressions. This change is more consistent with the behavior of
163 - Clang now accepts ``-std=c23`` and ``-std=gnu23`` as language standard modes,
164 and the ``__STDC_VERSION__`` macro now expands to ``202311L`` instead of its
165 previous placeholder value. Clang continues to accept ``-std=c2x`` and
166 ``-std=gnu2x`` as aliases for C23 and GNU C23, respectively.
167 - Clang now supports `requires c23` for module maps.
168 - Clang now supports ``N3007 Type inference for object definitions``.
170 Non-comprehensive list of changes in this release
171 -------------------------------------------------
176 * ``-fverify-intermediate-code`` and its complement ``-fno-verify-intermediate-code``.
177 Enables or disables verification of the generated LLVM IR.
178 Users can pass this to turn on extra verification to catch certain types of
179 compiler bugs at the cost of extra compile time.
180 Since enabling the verifier adds a non-trivial cost of a few percent impact on
181 build times, it's disabled by default, unless your LLVM distribution itself is
182 compiled with runtime checks enabled.
183 * ``-fkeep-system-includes`` modifies the behavior of the ``-E`` option,
184 preserving ``#include`` directives for "system" headers instead of copying
185 the preprocessed text to the output. This can greatly reduce the size of the
186 preprocessed output, which can be helpful when trying to reduce a test case.
188 Deprecated Compiler Flags
189 -------------------------
191 Modified Compiler Flags
192 -----------------------
194 * ``-Woverriding-t-option`` is renamed to ``-Woverriding-option``.
195 * ``-Winterrupt-service-routine`` is renamed to ``-Wexcessive-regsave`` as a generalization
196 * ``-frewrite-includes`` now guards the original #include directives with
197 ``__CLANG_REWRITTEN_INCLUDES``, and ``__CLANG_REWRITTEN_SYSTEM_INCLUDES`` as
200 Removed Compiler Flags
201 -------------------------
203 * ``-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang`` has been removed.
204 It has not been needed to enable ``-ftrivial-auto-var-init=zero`` since Clang 16.
206 Attribute Changes in Clang
207 --------------------------
208 - On X86, a warning is now emitted if a function with ``__attribute__((no_caller_saved_registers))``
209 calls a function without ``__attribute__((no_caller_saved_registers))``, and is not compiled with
210 ``-mgeneral-regs-only``
211 - On X86, a function with ``__attribute__((interrupt))`` can now call a function without
212 ``__attribute__((no_caller_saved_registers))`` provided that it is compiled with ``-mgeneral-regs-only``
214 - When a non-variadic function is decorated with the ``format`` attribute,
215 Clang now checks that the format string would match the function's parameters'
216 types after default argument promotion. As a result, it's no longer an
217 automatic diagnostic to use parameters of types that the format style
218 supports but that are never the result of default argument promotion, such as
219 ``float``. (`#59824: <https://github.com/llvm/llvm-project/issues/59824>`_)
221 Improvements to Clang's diagnostics
222 -----------------------------------
223 - Clang constexpr evaluator now prints template arguments when displaying
224 template-specialization function calls.
225 - Clang contexpr evaluator now displays notes as well as an error when a constructor
226 of a base class is not called in the constructor of its derived class.
227 - Clang no longer emits ``-Wmissing-variable-declarations`` for variables declared
228 with the ``register`` storage class.
229 - Clang's ``-Wtautological-negation-compare`` flag now diagnoses logical
230 tautologies like ``x && !x`` and ``!x || x`` in expressions. This also
231 makes ``-Winfinite-recursion`` diagnose more cases.
232 (`#56035: <https://github.com/llvm/llvm-project/issues/56035>`_).
233 - Clang constexpr evaluator now diagnoses compound assignment operators against
234 uninitialized variables as a read of uninitialized object.
235 (`#51536 <https://github.com/llvm/llvm-project/issues/51536>`_)
236 - Clang's ``-Wformat-truncation`` now diagnoses ``snprintf`` call that is known to
237 result in string truncation.
238 (`#64871: <https://github.com/llvm/llvm-project/issues/64871>`_).
239 Existing warnings that similarly warn about the overflow in ``sprintf``
240 now falls under its own warning group ```-Wformat-overflow`` so that it can
241 be disabled separately from ``Wfortify-source``.
242 These two new warning groups have subgroups ``-Wformat-truncation-non-kprintf``
243 and ``-Wformat-overflow-non-kprintf``, respectively. These subgroups are used when
244 the format string contains ``%p`` format specifier.
245 Because Linux kernel's codebase has format extensions for ``%p``, kernel developers
246 are encouraged to disable these two subgroups by setting ``-Wno-format-truncation-non-kprintf``
247 and ``-Wno-format-overflow-non-kprintf`` in order to avoid false positives on
249 Also clang no longer emits false positive warnings about the output length of
250 ``%g`` format specifier and about ``%o, %x, %X`` with ``#`` flag.
251 - Clang now emits ``-Wcast-qual`` for functional-style cast expressions.
252 - Clang no longer emits irrelevant notes about unsatisfied constraint expressions
253 on the left-hand side of ``||`` when the right-hand side constraint is satisfied.
254 (`#54678: <https://github.com/llvm/llvm-project/issues/54678>`_).
255 - Clang now prints its 'note' diagnostic in cyan instead of black, to be more compatible
256 with terminals with dark background colors. This is also more consistent with GCC.
257 - The fix-it emitted by ``-Wformat`` for scoped enumerations now take the
258 enumeration's underlying type into account instead of suggesting a type just
259 based on the format string specifier being used.
260 - Clang now displays an improved diagnostic and a note when a defaulted special
261 member is marked ``constexpr`` in a class with a virtual base class
262 (`#64843: <https://github.com/llvm/llvm-project/issues/64843>`_).
263 - ``-Wfixed-enum-extension`` and ``-Wmicrosoft-fixed-enum`` diagnostics are no longer
264 emitted when building as C23, since C23 standardizes support for enums with a
265 fixed underlying type.
266 - When describing the failure of static assertion of `==` expression, clang prints the integer
267 representation of the value as well as its character representation when
268 the user-provided expression is of character type. If the character is
269 non-printable, clang now shows the escpaed character.
270 Clang also prints multi-byte characters if the user-provided expression
271 is of multi-byte character type.
277 static_assert("A\n"[1] == U'🌍');
283 source:1:15: error: static assertion failed due to requirement '"A\n"[1] == U'\U0001f30d''
284 1 | static_assert("A\n"[1] == U'🌍');
286 source:1:24: note: expression evaluates to ''
288 1 | static_assert("A\n"[1] == U'🌍');
295 source:1:15: error: static assertion failed due to requirement '"A\n"[1] == U'\U0001f30d''
296 1 | static_assert("A\n"[1] == U'🌍');
298 source:1:24: note: expression evaluates to ''\n' (0x0A, 10) == U'🌍' (0x1F30D, 127757)'
299 1 | static_assert("A\n"[1] == U'🌍');
301 - Clang now always diagnoses when using non-standard layout types in ``offsetof`` .
302 (`#64619: <https://github.com/llvm/llvm-project/issues/64619>`_)
304 Bug Fixes in This Version
305 -------------------------
306 - Fixed an issue where a class template specialization whose declaration is
307 instantiated in one module and whose definition is instantiated in another
308 module may end up with members associated with the wrong declaration of the
309 class, which can result in miscompiles in some cases.
310 - Fix crash on use of a variadic overloaded operator.
311 (`#42535 <https://github.com/llvm/llvm-project/issues/42535>`_)
312 - Fix a hang on valid C code passing a function type as an argument to
313 ``typeof`` to form a function declaration.
314 (`#64713 <https://github.com/llvm/llvm-project/issues/64713>`_)
315 - Clang now reports missing-field-initializers warning for missing designated
317 (`#56628 <https://github.com/llvm/llvm-project/issues/56628>`_)
318 - Clang now respects ``-fwrapv`` and ``-ftrapv`` for ``__builtin_abs`` and
320 (`#45129 <https://github.com/llvm/llvm-project/issues/45129>`_,
321 `#45794 <https://github.com/llvm/llvm-project/issues/45794>`_)
322 - Fixed an issue where accesses to the local variables of a coroutine during
323 ``await_suspend`` could be misoptimized, including accesses to the awaiter
325 (`#56301 <https://github.com/llvm/llvm-project/issues/56301>`_)
326 The current solution may bring performance regressions if the awaiters have
327 non-static data members. See
328 `#64945 <https://github.com/llvm/llvm-project/issues/64945>`_ for details.
329 - Clang now prints unnamed members in diagnostic messages instead of giving an
331 (`#63759 <https://github.com/llvm/llvm-project/issues/63759>`_)
332 - Fix crash in __builtin_strncmp and related builtins when the size value
333 exceeded the maximum value representable by int64_t. Fixes
334 (`#64876 <https://github.com/llvm/llvm-project/issues/64876>`_)
335 - Fixed an assertion if a function has cleanups and fatal erors.
336 (`#48974 <https://github.com/llvm/llvm-project/issues/48974>`_)
337 - Clang now emits an error if it is not possible to deduce array size for a
338 variable with incomplete array type.
339 (`#37257 <https://github.com/llvm/llvm-project/issues/37257>`_)
340 - Clang's ``-Wunused-private-field`` no longer warns on fields whose type is
341 declared with ``[[maybe_unused]]``.
342 (`#61334 <https://github.com/llvm/llvm-project/issues/61334>`_)
343 - For function multi-versioning using the ``target``, ``target_clones``, or
344 ``target_version`` attributes, remove comdat for internal linkage functions.
345 (`#65114 <https://github.com/llvm/llvm-project/issues/65114>`_)
346 - Clang now reports ``-Wformat`` for bool value and char specifier confusion
348 (`#64987 <https://github.com/llvm/llvm-project/issues/64987>`_)
349 - Support MSVC predefined macro expressions in constant expressions and in
351 - Correctly parse non-ascii identifiers that appear immediately after a line splicing
352 (`#65156 <https://github.com/llvm/llvm-project/issues/65156>`_)
353 - Clang no longer considers the loss of ``__unaligned`` qualifier from objects as
354 an invalid conversion during method function overload resolution.
355 - Fix lack of comparison of declRefExpr in ASTStructuralEquivalence
356 (`#66047 <https://github.com/llvm/llvm-project/issues/66047>`_)
357 - Fix parser crash when dealing with ill-formed objective C++ header code. Fixes
358 (`#64836 <https://github.com/llvm/llvm-project/issues/64836>`_)
359 - Fix crash in implicit conversions from initialize list to arrays of unknown
360 bound for C++20. Fixes
361 (`#62945 <https://github.com/llvm/llvm-project/issues/62945>`_)
362 - Clang now allows an ``_Atomic`` qualified integer in a switch statement. Fixes
363 (`#65557 <https://github.com/llvm/llvm-project/issues/65557>`_)
364 - Fixes crash when trying to obtain the common sugared type of
365 `decltype(instantiation-dependent-expr)`.
366 Fixes (`#67603 <https://github.com/llvm/llvm-project/issues/67603>`_)
367 - Fixes a crash caused by a multidimensional array being captured by a lambda
368 (`#67722 <https://github.com/llvm/llvm-project/issues/67722>`_).
369 - Fixes a crash when instantiating a lambda with requires clause.
370 (`#64462 <https://github.com/llvm/llvm-project/issues/64462>`_)
371 - Fixes a regression where the ``UserDefinedLiteral`` was not properly preserved
372 while evaluating consteval functions. (`#63898 <https://github.com/llvm/llvm-project/issues/63898>`_).
373 - Fix a crash when evaluating value-dependent structured binding
374 variables at compile time.
375 Fixes (`#67690 <https://github.com/llvm/llvm-project/issues/67690>`_)
376 - Fixes a ``clang-17`` regression where ``LLVM_UNREACHABLE_OPTIMIZE=OFF``
377 cannot be used with ``Release`` mode builds. (`#68237 <https://github.com/llvm/llvm-project/issues/68237>`_).
378 - Fix crash in evaluating ``constexpr`` value for invalid template function.
379 Fixes (`#68542 <https://github.com/llvm/llvm-project/issues/68542>`_)
381 - Fixed an issue when a shift count larger than ``__INT64_MAX__``, in a right
382 shift operation, could result in missing warnings about
383 ``shift count >= width of type`` or internal compiler error.
385 Bug Fixes to Compiler Builtins
386 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
388 Bug Fixes to Attribute Support
389 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
391 Bug Fixes to C++ Support
392 ^^^^^^^^^^^^^^^^^^^^^^^^
394 - Clang limits the size of arrays it will try to evaluate at compile time
395 to avoid memory exhaustion.
396 This limit can be modified by `-fconstexpr-steps`.
397 (`#63562 <https://github.com/llvm/llvm-project/issues/63562>`_)
399 - Fix a crash caused by some named unicode escape sequences designating
400 a Unicode character whose name contains a ``-``.
401 (Fixes `#64161 <https://github.com/llvm/llvm-project/issues/64161>`_)
403 - Fix cases where we ignore ambiguous name lookup when looking up members.
404 (`#22413 <https://github.com/llvm/llvm-project/issues/22413>`_),
405 (`#29942 <https://github.com/llvm/llvm-project/issues/29942>`_),
406 (`#35574 <https://github.com/llvm/llvm-project/issues/35574>`_) and
407 (`#27224 <https://github.com/llvm/llvm-project/issues/27224>`_).
409 - Clang emits an error on substitution failure within lambda body inside a
410 requires-expression. This fixes:
411 (`#64138 <https://github.com/llvm/llvm-project/issues/64138>`_).
413 - Update ``FunctionDeclBitfields.NumFunctionDeclBits``. This fixes:
414 (`#64171 <https://github.com/llvm/llvm-project/issues/64171>`_).
416 - Expressions producing ``nullptr`` are correctly evaluated
417 by the constant interpreter when appearing as the operand
418 of a binary comparison.
419 (`#64923 <https://github.com/llvm/llvm-project/issues/64923>`_)
421 - Fix a crash when an immediate invocation is not a constant expression
422 and appear in an implicit cast.
423 (`#64949 <https://github.com/llvm/llvm-project/issues/64949>`_).
425 - Fix crash when parsing ill-formed lambda trailing return type. Fixes:
426 (`#64962 <https://github.com/llvm/llvm-project/issues/64962>`_) and
427 (`#28679 <https://github.com/llvm/llvm-project/issues/28679>`_).
429 - Fix a crash caused by substitution failure in expression requirements.
430 (`#64172 <https://github.com/llvm/llvm-project/issues/64172>`_) and
431 (`#64723 <https://github.com/llvm/llvm-project/issues/64723>`_).
433 - Fix crash when parsing the requires clause of some generic lambdas.
434 (`#64689 <https://github.com/llvm/llvm-project/issues/64689>`_)
436 - Fix crash when the trailing return type of a generic and dependent
437 lambda refers to an init-capture.
438 (`#65067 <https://github.com/llvm/llvm-project/issues/65067>`_ and
439 `#63675 <https://github.com/llvm/llvm-project/issues/63675>`_)
441 - Clang now properly handles out of line template specializations when there is
442 a non-template inner-class between the function and the class template.
443 (`#65810 <https://github.com/llvm/llvm-project/issues/65810>`_)
445 - Fix a crash when calling a non-constant immediate function
446 in the initializer of a static data member.
447 (`#65985 <https://github.com/llvm/llvm-project/issues/65985>_`).
448 - Clang now properly converts static lambda call operator to function
450 (`#62594 <https://github.com/llvm/llvm-project/issues/62594>`_)
452 - Fixed some cases where the source location for an instantiated specialization
453 of a function template or a member function of a class template was assigned
454 the location of a non-defining declaration rather than the location of the
455 definition the specialization was instantiated from.
456 (`#26057 <https://github.com/llvm/llvm-project/issues/26057>`_`)
458 - Fix a crash when a default member initializer of a base aggregate
459 makes an invalid call to an immediate function.
460 (`#66324 <https://github.com/llvm/llvm-project/issues/66324>`_)
462 - Fix crash for a lambda attribute with a statement expression
463 that contains a `return`.
464 (`#48527 <https://github.com/llvm/llvm-project/issues/48527>`_)
466 - Clang now no longer asserts when an UnresolvedLookupExpr is used as an
467 expression requirement. (`#66612 https://github.com/llvm/llvm-project/issues/66612`)
469 - Clang now disambiguates NTTP types when printing diagnostics where the
470 NTTP types are compared with the 'diff' method.
471 (`#66744 https://github.com/llvm/llvm-project/issues/66744`)
473 - Fix crash caused by a spaceship operator returning a comparision category by
475 (`#64162 <https://github.com/llvm/llvm-project/issues/64162>`_)
476 - Fix a crash when calling a consteval function in an expression used as
477 the size of an array.
478 (`#65520 <https://github.com/llvm/llvm-project/issues/65520>`_)
480 - Clang no longer tries to capture non-odr-used variables that appear
481 in the enclosing expression of a lambda expression with a noexcept specifier.
482 (`#67492 <https://github.com/llvm/llvm-project/issues/67492>`_)
484 - Fix crash when fold expression was used in the initialization of default
486 (`#67395 <https://github.com/llvm/llvm-project/issues/67395>`_)
488 - Fixed a bug causing destructors of constant-evaluated structured bindings
489 initialized by array elements to be called in the wrong evaluation context.
491 - Fix crash where ill-formed code was being treated as a deduction guide and
492 we now produce a diagnostic. Fixes:
493 (`#65522 <https://github.com/llvm/llvm-project/issues/65522>`_)
495 - Fixed a bug where clang incorrectly considered implicitly generated deduction
496 guides from a non-templated constructor and a templated constructor as ambiguous,
497 rather than prefer the non-templated constructor as specified in
500 Bug Fixes to AST Handling
501 ^^^^^^^^^^^^^^^^^^^^^^^^^
502 - Fixed an import failure of recursive friend class template.
503 `Issue 64169 <https://github.com/llvm/llvm-project/issues/64169>`_
504 - Remove unnecessary RecordLayout computation when importing UnaryOperator. The
505 computed RecordLayout is incorrect if fields are not completely imported and
506 should not be cached.
507 `Issue 64170 <https://github.com/llvm/llvm-project/issues/64170>`_
509 Miscellaneous Bug Fixes
510 ^^^^^^^^^^^^^^^^^^^^^^^
512 Miscellaneous Clang Crashes Fixed
513 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
514 - Fixed a crash when parsing top-level ObjC blocks that aren't properly
515 terminated. Clang should now also recover better when an @end is missing
517 `Issue 64065 <https://github.com/llvm/llvm-project/issues/64065>`_
518 - Fixed a crash when check array access on zero-length element.
519 `Issue 64564 <https://github.com/llvm/llvm-project/issues/64564>`_
520 - Fixed a crash when an ObjC ivar has an invalid type. See
521 (`#68001 <https://github.com/llvm/llvm-project/pull/68001>`_)
523 Target Specific Changes
524 -----------------------
528 - Use pass-by-reference (byref) in stead of pass-by-value (byval) for struct
529 arguments in C ABI. Callee is responsible for allocating stack memory and
530 copying the value of the struct if modified. Note that AMDGPU backend still
531 supports byval for struct arguments.
536 - Added option ``-m[no-]evex512`` to disable ZMM and 64-bit mask instructions
539 Arm and AArch64 Support
540 ^^^^^^^^^^^^^^^^^^^^^^^
545 - Android target triples are usually suffixed with a version. Clang searches for
546 target-specific runtime and standard libraries in directories named after the
547 target (e.g. if you're building with ``--target=aarch64-none-linux-android21``,
548 Clang will look for ``lib/aarch64-none-linux-android21`` under its resource
549 directory to find runtime libraries). If an exact match isn't found, Clang
550 would previously fall back to a directory without any version (which would be
551 ``lib/aarch64-none-linux-android`` in our example). Clang will now look for
552 directories for lower versions and use the newest version it finds instead,
553 e.g. if you have ``lib/aarch64-none-linux-android21`` and
554 ``lib/aarch64-none-linux-android29``, ``-target aarch64-none-linux-android23``
555 will use the former and ``-target aarch64-none-linux-android30`` will use the
556 latter. Falling back to a versionless directory will now emit a warning, and
557 the fallback will be removed in Clang 19.
561 - Fixed an assertion failure that occurred due to a failure to propagate
562 ``MSInheritanceAttr`` attributes to class template instantiations created
563 for explicit template instantiation declarations.
565 - The ``-fno-auto-import`` option was added for MinGW targets. The option both
566 affects code generation (inhibiting generating indirection via ``.refptr``
567 stubs for potentially auto imported symbols, generating smaller and more
568 efficient code) and linking (making the linker error out on such cases).
569 If the option only is used during code generation but not when linking,
570 linking may succeed but the resulting executables may expose issues at
578 - Unaligned memory accesses can be toggled by ``-m[no-]unaligned-access`` or the
579 aliases ``-m[no-]strict-align``.
581 CUDA/HIP Language Changes
582 ^^^^^^^^^^^^^^^^^^^^^^^^^
590 - Introduced the ``-maix-small-local-exec-tls`` option to produce a faster
591 access sequence for local-exec TLS variables where the offset from the TLS
592 base is encoded as an immediate operand.
593 This access sequence is not used for TLS variables larger than 32KB, and is
594 currently only supported on 64-bit mode.
602 DWARF Support in Clang
603 ----------------------
605 Floating Point Support in Clang
606 -------------------------------
607 - Add ``__builtin_elementwise_log`` builtin for floating point types only.
608 - Add ``__builtin_elementwise_log10`` builtin for floating point types only.
609 - Add ``__builtin_elementwise_log2`` builtin for floating point types only.
610 - Add ``__builtin_elementwise_exp`` builtin for floating point types only.
611 - Add ``__builtin_elementwise_exp2`` builtin for floating point types only.
612 - Add ``__builtin_set_flt_rounds`` builtin for X86, x86_64, Arm and AArch64 only.
613 - Add ``__builtin_elementwise_pow`` builtin for floating point types only.
614 - Add ``__builtin_elementwise_bitreverse`` builtin for integer types only.
615 - Add ``__builtin_elementwise_sqrt`` builtin for floating point types only.
616 - ``__builtin_isfpclass`` builtin now supports vector types.
617 - ``#pragma float_control(precise,on)`` enables precise floating-point
618 semantics. If ``math-errno`` is disabled in the current TU, clang will
619 re-enable ``math-errno`` in the presense of
620 ``#pragma float_control(precise,on)``.
621 - Add ``__builtin_exp10``, ``__builtin_exp10f``,
622 ``__builtin_exp10f16``, ``__builtin_exp10l`` and
623 ``__builtin_exp10f128`` builtins.
627 - Add ``convertVectorExpr``.
628 - Add ``dependentSizedExtVectorType``.
629 - Add ``macroQualifiedType``.
633 - Add ``AllowBreakBeforeNoexceptSpecifier`` option.
638 - Exposed arguments of ``clang::annotate``.
643 - Added a new checker ``core.BitwiseShift`` which reports situations where
644 bitwise shift operators produce undefined behavior (because some operand is
645 negative or too large).
647 - Fix false positive in mutation check when using pointer to member function.
648 (`#66204: <https://github.com/llvm/llvm-project/issues/66204>`_).
650 - The ``alpha.security.taint.TaintPropagation`` checker no longer propagates
651 taint on ``strlen`` and ``strnlen`` calls, unless these are marked
652 explicitly propagators in the user-provided taint configuration file.
653 This removal empirically reduces the number of false positive reports.
654 Read the PR for the details.
655 (`#66086 <https://github.com/llvm/llvm-project/pull/66086>`_)
657 - A few crashes have been found and fixed using randomized testing related
658 to the use of ``_BitInt()`` in tidy checks and in clang analysis. See
659 `#67212 <https://github.com/llvm/llvm-project/pull/67212>`_,
660 `#66782 <https://github.com/llvm/llvm-project/pull/66782>`_,
661 `#65889 <https://github.com/llvm/llvm-project/pull/65889>`_,
662 `#65888 <https://github.com/llvm/llvm-project/pull/65888>`_, and
663 `#65887 <https://github.com/llvm/llvm-project/pull/65887>`_
665 .. _release-notes-sanitizers:
670 - ``-fsanitize=signed-integer-overflow`` now instruments ``__builtin_abs`` and
673 Python Binding Changes
674 ----------------------
676 Additional Information
677 ======================
679 A wide variety of additional information is available on the `Clang web
680 page <https://clang.llvm.org/>`_. The web page contains versions of the
681 API documentation which are up-to-date with the Git version of
682 the source code. You can access versions of these documents specific to
683 this release by going into the "``clang/docs/``" directory in the Clang
686 If you have any questions or comments about Clang, please feel free to
687 contact us on the `Discourse forums (Clang Frontend category)
688 <https://discourse.llvm.org/c/clang/6>`_.