793 lines · plain
1.. If you want to modify sections/contents permanently, you should modify both2 ReleaseNotes.rst and ReleaseNotesTemplate.txt.3 4===========================================5Clang |release| |ReleaseNotesTitle|6===========================================7 8.. contents::9 :local:10 :depth: 211 12Written by the `LLVM Team <https://llvm.org/>`_13 14.. only:: PreRelease15 16 .. warning::17 These are in-progress notes for the upcoming Clang |version| release.18 Release notes for previous releases can be found on19 `the Releases Page <https://llvm.org/releases/>`_.20 21Introduction22============23 24This document contains the release notes for the Clang C/C++/Objective-C25frontend, part of the LLVM Compiler Infrastructure, release |release|. Here we26describe the status of Clang in some detail, including major27improvements from the previous release and new feature work. For the28general LLVM release notes, see `the LLVM29documentation <https://llvm.org/docs/ReleaseNotes.html>`_. For the libc++ release notes,30see `this page <https://libcxx.llvm.org/ReleaseNotes.html>`_. All LLVM releases31may be downloaded from the `LLVM releases web site <https://llvm.org/releases/>`_.32 33For more information about Clang or LLVM, including information about the34latest release, please see the `Clang Web Site <https://clang.llvm.org>`_ or the35`LLVM Web Site <https://llvm.org>`_.36 37Potentially Breaking Changes38============================39 40- Clang will now emit a warning if the auto-detected GCC installation41 directory (i.e. the one with the largest version number) does not42 contain libstdc++ include directories although a "complete" GCC43 installation directory containing the include directories is44 available. It is planned to change the auto-detection to prefer the45 "complete" directory in the future. The warning will disappear if46 the libstdc++ include directories are either installed or removed47 for all GCC installation directories considered by the48 auto-detection; see the output of ``clang -v`` for a list of those49 directories. If the GCC installations cannot be modified and50 maintaining the current choice of the auto-detection is desired, the51 GCC installation directory can be selected explicitly using the52 ``--gcc-install-dir`` command line argument. This will silence the53 warning. It can also be disabled using the54 ``-Wno-gcc-install-dir-libstdcxx`` command line flag.55- Scalar deleting destructor support has been aligned with MSVC when56 targeting the MSVC ABI. Clang previously implemented support for57 ``::delete`` by calling the complete object destructor and then the58 appropriate global delete operator (as is done for the Itanium ABI).59 The scalar deleting destructor is now called to destroy the object60 and deallocate its storage. This is an ABI change that can result in61 memory corruption when a program built for the MSVC ABI has62 portions compiled with clang 21 or earlier and portions compiled63 with a version of clang 22 (or MSVC). Consider a class ``X`` that64 declares a virtual destructor and an ``operator delete`` member65 with the destructor defined in library ``A`` and a call to `::delete`` in66 library ``B``. If library ``A`` is compiled with clang 21 and library ``B``67 is compiled with clang 22, the ``::delete`` call might dispatch to the68 scalar deleting destructor emitted in library ``A`` which will erroneously69 call the member ``operator delete`` instead of the expected global70 delete operator. The old behavior is retained under ``-fclang-abi-compat=21``71 flag.72- Clang warning suppressions file, ``--warning-suppression-mappings=``, now will73 use the last matching entry instead of the longest one.74- Trailing null statements in GNU statement expressions are no longer75 ignored by Clang; they now result in a void type. Clang previously76 matched GCC's behavior, which was recently clarified to be incorrect.77 78 .. code-block:: c++79 80 // The resulting type is 'void', not 'int'81 void foo(void) {82 return ({ 1;; });83 }84- Downstream projects that previously linked only against ``clangDriver`` may85 now (also) need to link against the new ``clangOptions`` library, since86 options-related code has been moved out of the Driver into a separate library.87- The ``clangFrontend`` library no longer depends on ``clangDriver``, which may88 break downstream projects that relied on this transitive dependency.89 90C/C++ Language Potentially Breaking Changes91-------------------------------------------92 93- The ``__has_builtin`` function now only considers the currently active target when being used with target offloading.94 95- The ``-Wincompatible-pointer-types`` diagnostic now defaults to an error;96 it can still be downgraded to a warning by passing ``-Wno-error=incompatible-pointer-types``. (#GH74605)97 98C++ Specific Potentially Breaking Changes99-----------------------------------------100- For C++20 modules, the Reduced BMI mode will be the default option. This may introduce101 regressions if your build system supports two-phase compilation model but haven't support102 reduced BMI or it is a compiler bug or a bug in users code.103 104- Clang now correctly diagnoses during constant expression evaluation undefined behavior due to member105 pointer access to a member which is not a direct or indirect member of the most-derived object106 of the accessed object but is instead located directly in a sibling class to one of the classes107 along the inheritance hierarchy of the most-derived object as ill-formed.108 Other scenarios in which the member is not member of the most derived object were already109 diagnosed previously. (#GH150709)110 111 .. code-block:: c++112 113 struct A {};114 struct B : A {};115 struct C : A { constexpr int foo() const { return 1; } };116 constexpr A a;117 constexpr B b;118 constexpr C c;119 constexpr auto mp = static_cast<int(A::*)() const>(&C::foo);120 static_assert((a.*mp)() == 1); // continues to be rejected121 static_assert((b.*mp)() == 1); // newly rejected122 static_assert((c.*mp)() == 1); // accepted123 124- ``VarTemplateSpecializationDecl::getTemplateArgsAsWritten()`` method now125 returns ``nullptr`` for implicitly instantiated declarations.126 127ABI Changes in This Version128---------------------------129- Fix AArch64 argument passing for C++ empty classes with large explicitly specified alignment.130 131AST Dumping Potentially Breaking Changes132----------------------------------------133- How nested name specifiers are dumped and printed changes, keeping track of clang AST changes.134 135- Pretty-printing of atomic builtins ``__atomic_test_and_set`` and ``__atomic_clear`` in ``-ast-print`` output.136 These previously displayed an extra ``<null expr>`` argument, e.g.:137 138 ``__atomic_test_and_set(p, <null expr>, 0)``139 140 Now they are printed as:141 142 ``__atomic_test_and_set(p, 0)``143 144- Pretty-printing of templates with inherited (i.e. specified in a previous145 redeclaration) default arguments has been fixed.146 147- Default arguments of template template parameters are pretty-printed now.148 149- Pretty-printing of ``asm`` attributes are now always the first attribute150 on the right side of the declaration. Before we had, e.g.:151 152 ``__attribute__(("visibility")) asm("string")``153 154 Now we have:155 156 ``asm("string") __attribute__(("visibility"))``157 158 Which is accepted by both clang and gcc parsers.159 160Clang Frontend Potentially Breaking Changes161-------------------------------------------162- Members of anonymous unions/structs are now injected as ``IndirectFieldDecl``163 into the enclosing record even if their names conflict with other names in the164 scope. These ``IndirectFieldDecl`` are marked invalid.165 166Clang Python Bindings Potentially Breaking Changes167--------------------------------------------------168- Return ``None`` instead of null cursors from ``Token.cursor``169- TypeKind ``ELABORATED`` is not used anymore, per clang AST changes removing170 ElaboratedTypes. The value becomes unused, and all the existing users should171 expect the former underlying type to be reported instead.172- Remove ``AccessSpecifier.NONE`` kind. No libclang interfaces ever returned this kind.173 174What's New in Clang |release|?175==============================176 177C++ Language Changes178--------------------179 180- A new family of builtins ``__builtin_*_synthesizes_from_spaceship`` has been added. These can be queried to know181 whether the ``<`` (``lt``), ``>`` (``gt``), ``<=`` (``le``), or ``>=`` (``ge``) operators are synthesized from a182 ``<=>``. This makes it possible to optimize certain facilities by using the ``<=>`` operation directly instead of183 doing multiple comparisons.184 185C++2c Feature Support186^^^^^^^^^^^^^^^^^^^^^187 188- Started the implementation of `P2686R5 <https://wg21.link/P2686R5>`_ Constexpr structured bindings.189 At this timem, references to constexpr and decomposition of *tuple-like* types are not supported190 (only arrays and aggregates are).191 192C++23 Feature Support193^^^^^^^^^^^^^^^^^^^^^194 195C++20 Feature Support196^^^^^^^^^^^^^^^^^^^^^197 198- Clang now normalizes constraints before checking whether they are satisfied, as mandated by the standard.199 As a result, Clang no longer incorrectly diagnoses substitution failures in template arguments only200 used in concept-ids, and produces better diagnostics for satisfaction failure. (#GH61811) (#GH135190)201 202C++17 Feature Support203^^^^^^^^^^^^^^^^^^^^^204 205Resolutions to C++ Defect Reports206^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^207 208C Language Changes209------------------210 211C2y Feature Support212^^^^^^^^^^^^^^^^^^^213- No longer triggering ``-Wstatic-in-inline`` in C2y mode; use of a static214 function or variable within an extern inline function is no longer a215 constraint per `WG14 N3622 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3622.txt>`_.216- Clang now supports `N3355 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm>`_ Named Loops.217- Clang's implementation of ``__COUNTER__`` was updated to conform to218 `WG14 N3457 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3457.htm>`_.219 This includes adding pedantic warnings for the feature being an extension in220 other language modes as well as an error when the counter is expanded more221 than 2147483647 times.222 223C23 Feature Support224^^^^^^^^^^^^^^^^^^^225- Added ``FLT_SNAN``, ``DBL_SNAN``, and ``LDBL_SNAN`` to Clang's ``<float.h>``226 header in C23 and later modes. This implements227 `WG14 N2710 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2710.htm>`_.228- Fixed accepting as compatible unnamed tag types with the same fields within229 the same translation unit but from different types.230- ``-MG`` now silences the "file not found" errors with ``#embed`` when231 scanning for dependencies and encountering an unknown file. #GH165632232 233Non-comprehensive list of changes in this release234-------------------------------------------------235- Added ``__scoped_atomic_uinc_wrap`` and ``__scoped_atomic_udec_wrap``.236 237- Removed OpenCL header-only feature macros (previously unconditionally enabled238 on SPIR-V and only selectively disabled via ``-D__undef_<feature>``). All239 OpenCL extensions and features are now centralized in OpenCLExtensions.def,240 allowing consistent control via ``getSupportedOpenCLOpts`` and ``-cl-ext``.241 242- Added ``__builtin_elementwise_ldexp``.243 244- Added ``__builtin_elementwise_fshl`` and ``__builtin_elementwise_fshr``.245 246- ``__builtin_elementwise_abs`` can now be used in constant expression.247 248- Added ``__builtin_elementwise_minnumnum`` and ``__builtin_elementwise_maxnumnum``.249 250- Trapping UBSan (e.g. ``-fsanitize=undefined -fsanitize-trap=undefined``) now251 emits a string describing the reason for trapping into the generated debug252 info. This feature allows debuggers (e.g. LLDB) to display the reason for253 trapping if the trap is reached. The string is currently encoded in the debug254 info as an artificial frame that claims to be inlined at the trap location.255 The function used for the artificial frame is an artificial function whose256 name encodes the reason for trapping. The encoding used is currently the same257 as ``__builtin_verbose_trap`` but might change in the future. This feature is258 enabled by default but can be disabled by compiling with259 ``-fno-sanitize-debug-trap-reasons``. The feature has a ``basic`` and260 ``detailed`` mode (the default). The ``basic`` mode emits a hard-coded string261 per trap kind (e.g. ``Integer addition overflowed``) and the ``detailed`` mode262 emits a more descriptive string describing each individual trap (e.g. ``signed263 integer addition overflow in 'a + b'``). The ``detailed`` mode produces larger264 debug info than ``basic`` but is more helpful for debugging. The265 ``-fsanitize-debug-trap-reasons=`` flag can be used to switch between the266 different modes or disable the feature entirely. Note due to trap merging in267 optimized builds (i.e. in each function all traps of the same kind get merged268 into the same trap instruction) the trap reasons might be removed. To prevent269 this build without optimizations (i.e. use `-O0` or use the `optnone` function270 attribute) or use the `fno-sanitize-merge=` flag in optimized builds.271 272- ``__builtin_elementwise_max`` and ``__builtin_elementwise_min`` functions for integer types can273 now be used in constant expressions.274 275- A vector of booleans is now a valid condition for the ternary ``?:`` operator.276 This binds to a simple vector select operation.277 278- Added ``__builtin_masked_load``, ``__builtin_masked_expand_load``,279 ``__builtin_masked_store``, ``__builtin_masked_compress_store`` for280 conditional memory loads from vectors. Binds to the LLVM intrinsics of the281 same name.282 283- Added ``__builtin_masked_gather`` and ``__builtin_masked_scatter`` for284 conditional gathering and scattering operations on vectors. Binds to the LLVM285 intrinsics of the same name.286 287- The ``__builtin_popcountg``, ``__builtin_ctzg``, and ``__builtin_clzg``288 functions now accept fixed-size boolean vectors.289 290- Use of ``__has_feature`` to detect the ``ptrauth_qualifier`` and ``ptrauth_intrinsics``291 features has been deprecated, and is restricted to the arm64e target only. The292 correct method to check for these features is to test for the ``__PTRAUTH__``293 macro.294 295- Added a new builtin, ``__builtin_dedup_pack``, to remove duplicate types from a parameter pack.296 This feature is particularly useful in template metaprogramming for normalizing type lists.297 The builtin produces a new, unexpanded parameter pack that can be used in contexts like template298 argument lists or base specifiers.299 300 .. code-block:: c++301 302 template <typename...> struct TypeList;303 304 // The resulting type is TypeList<int, double, char>305 using MyTypeList = TypeList<__builtin_dedup_pack<int, double, int, char, double>...>;306 307 Currently, the use of ``__builtin_dedup_pack`` is limited to template arguments and base308 specifiers, it also must be used within a template context.309 310- ``__builtin_assume_dereferenceable`` now accepts non-constant size operands.311 312- Fixed a crash when the second argument to ``__builtin_assume_aligned`` was not constant (#GH161314)313 314- Introduce support for :doc:`allocation tokens <AllocToken>` to enable315 allocator-level heap organization strategies. A feature to instrument all316 allocation functions with a token ID can be enabled via the317 ``-fsanitize=alloc-token`` flag.318 319- A new generic byte swap builtin function ``__builtin_bswapg`` that extends the existing 320 __builtin_bswap{16,32,64} function family to support all standard integer types.321 322- A builtin ``__builtin_infer_alloc_token(<args>, ...)`` is provided to allow323 compile-time querying of allocation token IDs, where the builtin arguments324 mirror those normally passed to an allocation function.325 326- Clang now rejects the invalid use of ``constexpr`` with ``auto`` and an explicit type in C. (#GH163090)327 328New Compiler Flags329------------------330- New option ``-fno-sanitize-debug-trap-reasons`` added to disable emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``).331- New option ``-fsanitize-debug-trap-reasons=`` added to control emitting trap reasons into the debug info when compiling with trapping UBSan (e.g. ``-fsanitize-trap=undefined``).332- New options for enabling allocation token instrumentation: ``-fsanitize=alloc-token``, ``-falloc-token-max=``, ``-fsanitize-alloc-token-fast-abi``, ``-fsanitize-alloc-token-extended``.333- The ``-resource-dir`` option is now displayed in the list of options shown by ``--help``.334 335Lanai Support336^^^^^^^^^^^^^^337- The option ``-mcmodel={small,medium,large}`` is supported again.338 339Deprecated Compiler Flags340-------------------------341 342Modified Compiler Flags343-----------------------344- The `-gkey-instructions` compiler flag is now enabled by default when DWARF is emitted for plain C/C++ and optimizations are enabled. (#GH149509)345- The `-fconstexpr-steps` compiler flag now accepts value `0` to opt out of this limit. (#GH160440)346 347Removed Compiler Flags348-------------------------349 350Attribute Changes in Clang351--------------------------352- The definition of a function declaration with ``[[clang::cfi_unchecked_callee]]`` inherits this353 attribute, allowing the attribute to only be attached to the declaration. Prior, this would be354 treated as an error where the definition and declaration would have differing types.355 356- New format attributes ``gnu_printf``, ``gnu_scanf``, ``gnu_strftime`` and ``gnu_strfmon`` are added357 as aliases for ``printf``, ``scanf``, ``strftime`` and ``strfmon``. (#GH16219)358 359- New function attribute `malloc_span` is added. It has semantics similar to that of the `malloc`360 attribute, but `malloc_span` applies not to functions returning pointers, but to functions returning361 span-like structures (i.e. those that contain a pointer field and a size integer field or two pointers).362 363Improvements to Clang's diagnostics364-----------------------------------365- Diagnostics messages now refer to ``structured binding`` instead of ``decomposition``,366 to align with `P0615R0 <https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0615r0.html>`_ changing the term. (#GH157880)367- Clang now suppresses runtime behavior warnings for unreachable code in file-scope368 variable initializers, matching the behavior for functions. This prevents false369 positives for operations in unreachable branches of constant expressions.370- Added a separate diagnostic group ``-Wfunction-effect-redeclarations``, for the more pedantic371 diagnostics for function effects (``[[clang::nonblocking]]`` and ``[[clang::nonallocating]]``).372 Moved the warning for a missing (though implied) attribute on a redeclaration into this group.373 Added a new warning in this group for the case where the attribute is missing/implicit on374 an override of a virtual method.375- Remove ``-Wperf-constraint-implies-noexcept`` from ``-Wall``. This warning is somewhat nit-picky and376 attempts to resolve it, by adding ``noexcept``, can create new ways for programs to crash. (#GH167540)377- Implemented diagnostics when retrieving the tuple size for types where its specialization of `std::tuple_size`378 produces an invalid size (either negative or greater than the implementation limit). (#GH159563)379- Fixed fix-it hint for fold expressions. Clang now correctly places the suggested right380 parenthesis when diagnosing malformed fold expressions. (#GH151787)381- Added fix-it hint for when scoped enumerations require explicit conversions for binary operations. (#GH24265)382- Constant template parameters are now type checked in template definitions,383 including template template parameters.384- Fixed an issue where emitted format-signedness diagnostics were not associated with an appropriate385 diagnostic id. Besides being incorrect from an API standpoint, this was user visible, e.g.:386 "format specifies type 'unsigned int' but the argument has type 'int' [-Wformat]"387 "signedness of format specifier 'u' is incompatible with 'c' [-Wformat]"388 This was misleading, because even though -Wformat is required in order to emit the diagnostics,389 the warning flag the user needs to concerned with here is -Wformat-signedness, which is also390 required and is not enabled by default. With the change you'll now see:391 "format specifies type 'unsigned int' but the argument has type 'int', which differs in signedness [-Wformat-signedness]"392 "signedness of format specifier 'u' is incompatible with 'c' [-Wformat-signedness]"393 and the API-visible diagnostic id will be appropriate.394- Clang now produces better diagnostics for template template parameter matching395 involving 'auto' template parameters.396- Fixed false positives in ``-Waddress-of-packed-member`` diagnostics when397 potential misaligned members get processed before they can get discarded.398 (#GH144729)399- Fix a false positive warning in ``-Wignored-qualifiers`` when the return type is undeduced. (#GH43054)400 401- Clang now emits a diagnostic with the correct message in case of assigning to const reference captured in lambda. (#GH105647)402 403- Fixed false positive in ``-Wmissing-noreturn`` diagnostic when it was requiring the usage of404 ``[[noreturn]]`` on lambdas before C++23 (#GH154493).405 406- Clang now diagnoses the use of ``#`` and ``##`` preprocessor tokens in407 attribute argument lists in C++ when ``-pedantic`` is enabled. The operators408 can be used in macro replacement lists with the usual preprocessor semantics,409 however, non-preprocessor use of tokens now triggers a pedantic warning in C++.410 Compilation in C mode is unchanged, and still permits these tokens to be used. (#GH147217)411 412- Clang now diagnoses misplaced array bounds on declarators for template413 specializations in th same way as it already did for other declarators.414 (#GH147333)415 416- A new warning ``-Walloc-size`` has been added to detect calls to functions417 decorated with the ``alloc_size`` attribute don't allocate enough space for418 the target pointer type.419 420- The :doc:`ThreadSafetyAnalysis` attributes ``ACQUIRED_BEFORE(...)`` and421 ``ACQUIRED_AFTER(...)`` have been moved to the stable feature set and no422 longer require ``-Wthread-safety-beta`` to be used.423- The :doc:`ThreadSafetyAnalysis` gains basic alias-analysis of capability424 pointers under ``-Wthread-safety-beta`` (still experimental), which reduces425 both false positives but also false negatives through more precise analysis.426 427- Clang now looks through parenthesis for ``-Wundefined-reinterpret-cast`` diagnostic.428 429- Fixed a bug where the source location was missing when diagnosing ill-formed430 placeholder constraints.431 432- The two-element, unary mask variant of ``__builtin_shufflevector`` is now433 properly being rejected when used at compile-time. It was not implemented434 and caused assertion failures before (#GH158471).435 436- Closed a loophole in the diagnosis of function pointer conversions changing437 extended function type information in C mode (#GH41465). Function conversions438 that were previously incorrectly accepted in case of other irrelevant439 conditions are now consistently diagnosed, identical to C++ mode.440 441- Fix false-positive unused label diagnostic when a label is used in a named break442 or continue (#GH166013)443- Clang now emits a diagnostic in case `vector_size` or `ext_vector_type`444 attributes are used with a negative size (#GH165463).445- Clang no longer emits ``-Wmissing-noreturn`` for virtual methods where446 the function body consists of a `throw` expression (#GH167247).447 448- A new warning ``-Wenum-compare-typo`` has been added to detect potential erroneous449 comparison operators when mixed with bitwise operators in enum value initializers.450 This can be locally disabled by explicitly casting the initializer value.451 452Improvements to Clang's time-trace453----------------------------------454 455Improvements to Coverage Mapping456--------------------------------457 458Bug Fixes in This Version459-------------------------460- Fix a crash when marco name is empty in ``#pragma push_macro("")`` or461 ``#pragma pop_macro("")``. (#GH149762).462- Fix a crash in variable length array (e.g. ``int a[*]``) function parameter type463 being used in ``_Countof`` expression. (#GH152826).464- ``-Wunreachable-code`` now diagnoses tautological or contradictory465 comparisons such as ``x != 0 || x != 1.0`` and ``x == 0 && x == 1.0`` on466 targets that treat ``_Float16``/``__fp16`` as native scalar types. Previously467 the warning was silently lost because the operands differed only by an implicit468 cast chain. (#GH149967).469- Fix crash in ``__builtin_function_start`` by checking for invalid470 first parameter. (#GH113323).471- Fixed a crash with incompatible pointer to integer conversions in designated472 initializers involving string literals. (#GH154046)473- Fix crash on CTAD for alias template. (#GH131342), (#GH131408)474- Clang now emits a frontend error when a function marked with the `flatten` attribute475 calls another function that requires target features not enabled in the caller. This476 prevents a fatal error in the backend.477- Fixed scope of typedefs present inside a template class. (#GH91451)478- Builtin elementwise operators now accept vector arguments that have different479 qualifiers on their elements. For example, vector of 4 ``const float`` values480 and vector of 4 ``float`` values. (#GH155405)481- Fixed inconsistent shadow warnings for lambda capture of structured bindings.482 Previously, ``[val = val]`` (regular parameter) produced no warnings with ``-Wshadow``483 while ``[a = a]`` (where ``a`` is from ``auto [a, b] = std::make_pair(1, 2)``)484 incorrectly produced warnings. Both cases now consistently show no warnings with485 ``-Wshadow`` and show uncaptured-local warnings with ``-Wshadow-all``. (#GH68605)486- Fixed a failed assertion with a negative limit parameter value inside of487 ``__has_embed``. (#GH157842)488- Fixed an assertion when an improper use of the ``malloc`` attribute targeting489 a function without arguments caused us to try to access a non-existent argument.490 (#GH159080)491- Fixed a failed assertion with empty filename arguments in ``__has_embed``. (#GH159898)492- Fixed a failed assertion with empty filename in ``#embed`` directive. (#GH162951)493- Fixed a crash triggered by unterminated ``__has_embed``. (#GH162953)494- Accept empty enumerations in MSVC-compatible C mode. (#GH114402)495- Fix a bug leading to incorrect code generation with complex number compound assignment and bitfield values, which also caused a crash with UBsan. (#GH166798)496- Fixed false-positive shadow diagnostics for lambdas in explicit object member functions. (#GH163731)497- Fix an assertion failure when a ``target_clones`` attribute is only on the498 forward declaration of a multiversioned function. (#GH165517) (#GH129483)499 500Bug Fixes to Compiler Builtins501^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^502- Fix an ambiguous reference to the builtin `type_info` (available when using503 `-fms-compatibility`) with modules. (#GH38400)504 505Bug Fixes to Attribute Support506^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^507 508- ``[[nodiscard]]`` is now respected on Objective-C and Objective-C++ methods509 (#GH141504) and on types returned from indirect calls (#GH142453).510- Fixes some late parsed attributes, when applied to function definitions, not being parsed511 in function try blocks, and some situations where parsing of the function body512 is skipped, such as error recovery, code completion, and msvc-compatible delayed513 template parsing. (#GH153551)514- Using ``[[gnu::cleanup(some_func)]]`` where some_func is annotated with515 ``[[gnu::error("some error")]]`` now correctly triggers an error. (#GH146520)516- Fix a crash when the function name is empty in the `swift_name` attribute. (#GH157075)517- Fixes crashes or missing diagnostics with the `device_kernel` attribute. (#GH161905)518- Fix handling of parameter indexes when an attribute is applied to a C++23 explicit object member function.519- Fixed several false positives and false negatives in function effect (`nonblocking`) analysis. (#GH166078) (#GH166101) (#GH166110)520- Fix ``cleanup`` attribute by delaying type checks until after the type is deduced. (#GH129631)521- Fix a crash when instantiating a function template with ``constructor`` or ``destructor``522 attributes without a priority argument. (#GH169072)523 524Bug Fixes to C++ Support525^^^^^^^^^^^^^^^^^^^^^^^^526- Diagnose binding a reference to ``*nullptr`` during constant evaluation. (#GH48665)527- Suppress ``-Wdeprecated-declarations`` in implicitly generated functions. (#GH147293)528- Fix a crash when deleting a pointer to an incomplete array (#GH150359).529- Fixed a mismatched lambda scope bug when propagating up ``consteval`` within nested lambdas. (#GH145776)530- Disallow immediate escalation in destructors. (#GH109096)531- Fix an assertion failure when expression in assumption attribute532 (``[[assume(expr)]]``) creates temporary objects.533- Fix the dynamic_cast to final class optimization to correctly handle534 casts that are guaranteed to fail (#GH137518).535- Fix bug rejecting partial specialization of variable templates with auto NTTPs (#GH118190).536- Fix a crash if errors "member of anonymous [...] redeclares" and537 "initializing multiple members of union" coincide (#GH149985).538- Fix a crash when using ``explicit(bool)`` in pre-C++11 language modes. (#GH152729)539- Fix the parsing of variadic member functions when the ellipis immediately follows a default argument.(#GH153445)540- Fixed a bug that caused ``this`` captured by value in a lambda with a dependent explicit object parameter to not be541 instantiated properly. (#GH154054)542- Fixed a bug where our ``member-like constrained friend`` checking caused an incorrect analysis of lambda captures. (#GH156225)543- Fixed a crash when implicit conversions from initialize list to arrays of544 unknown bound during constant evaluation. (#GH151716)545- Support the dynamic_cast to final class optimization with pointer546 authentication enabled. (#GH152601)547- Fix the check for narrowing int-to-float conversions, so that they are detected in548 cases where converting the float back to an integer is undefined behaviour (#GH157067).549- Stop rejecting C++11-style attributes on the first argument of constructors in older550 standards. (#GH156809).551- Fix a crash when applying binary or ternary operators to two same function types with different spellings,552 where at least one of the function parameters has an attribute which affects553 the function type.554- Fix an assertion failure when a ``constexpr`` variable is only referenced through555 ``__builtin_addressof``, and related issues with builtin arguments. (#GH154034)556- Fix an assertion failure when taking the address on a non-type template parameter argument of557 object type. (#GH151531)558- Suppress ``-Wdouble-promotion`` when explicitly asked for with C++ list initialization (#GH33409).559- Fix the result of `__builtin_is_implicit_lifetime` for types with a user-provided constructor. (#GH160610)560- Correctly deduce return types in ``decltype`` expressions. (#GH160497) (#GH56652) (#GH116319) (#GH161196)561- Fixed a crash in the pre-C++23 warning for attributes before a lambda declarator (#GH161070).562- Fix a crash when attempting to deduce a deduction guide from a non deducible template template parameter. (#130604)563- Fix for clang incorrectly rejecting the default construction of a union with564 nontrivial member when another member has an initializer. (#GH81774)565- Fixed a template depth issue when parsing lambdas inside a type constraint. (#GH162092)566- Diagnose unresolved overload sets in non-dependent compound requirements. (#GH51246) (#GH97753)567- Fix a crash when extracting unavailable member type from alias in template deduction. (#GH165560)568- Fix incorrect diagnostics for lambdas with init-captures inside braced initializers. (#GH163498)569- Fixed spurious diagnoses of certain nested lambda expressions. (#GH149121) (#GH156579)570 571Bug Fixes to AST Handling572^^^^^^^^^^^^^^^^^^^^^^^^^573- Fix incorrect name qualifiers applied to alias CTAD. (#GH136624)574- Fixed ElaboratedTypes appearing within NestedNameSpecifier, which was not a575 legal representation. This is fixed because ElaboratedTypes don't exist anymore. (#GH43179) (#GH68670) (#GH92757)576- Fix unrecognized html tag causing undesirable comment lexing (#GH152944)577- Fix comment lexing of special command names (#GH152943)578- Use `extern` as a hint to continue parsing when recovering from a malformed declaration.579 580Miscellaneous Bug Fixes581^^^^^^^^^^^^^^^^^^^^^^^582- Fixed missing diagnostics of ``diagnose_if`` on templates involved in initialization. (#GH160776)583 584Miscellaneous Clang Crashes Fixed585^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^586 587OpenACC Specific Changes588------------------------589 590Target Specific Changes591-----------------------592 593AMDGPU Support594^^^^^^^^^^^^^^595 596NVPTX Support597^^^^^^^^^^^^^^598 599X86 Support600^^^^^^^^^^^601- More SSE, AVX and AVX512 intrinsics, including initializers and general602 arithmetic can now be used in C++ constant expressions.603- Some SSE, AVX and AVX512 intrinsics have been converted to wrap604 generic __builtin intrinsics.605- NOTE: Please avoid use of the __builtin_ia32_* intrinsics - these are not606 guaranteed to exist in future releases, or match behaviour with previous607 releases of clang or other compilers.608- Remove `m[no-]avx10.x-[256,512]` and `m[no-]evex512` options from Clang609 driver.610- Remove `[no-]evex512` feature request from intrinsics and builtins.611- Change features `avx10.x-[256,512]` to `avx10.x`.612- `-march=wildcatlake` is now supported.613- `-march=novalake` is now supported.614 615Arm and AArch64 Support616^^^^^^^^^^^^^^^^^^^^^^^617- More intrinsics for the following AArch64 instructions:618 FCVTZ[US], FCVTN[US], FCVTM[US], FCVTP[US], FCVTA[US]619 620Android Support621^^^^^^^^^^^^^^^622 623Windows Support624^^^^^^^^^^^^^^^625- clang-cl now supports /arch:AVX10.1 and /arch:AVX10.2.626- clang-cl now supports /vlen, /vlen=256 and /vlen=512.627 628LoongArch Support629^^^^^^^^^^^^^^^^^630- Enable linker relaxation by default for loongarch64.631 632RISC-V Support633^^^^^^^^^^^^^^634 635- Add support for `__attribute__((interrupt("rnmi")))` to be used with the `Smrnmi` extension.636 With this the `Smrnmi` extension is fully supported.637 638- Add `-march=unset` to clear any previous `-march=` value. This ISA string will639 be computed from `-mcpu` or the platform default.640 641- `__GCC_CONSTRUCTIVE_SIZE` and `__GCC_DESTRUCTIVE_SIZE` are changed to 64. These values are642 unstable according to `Clang's documentation <https://clang.llvm.org/docs/LanguageExtensions.html#gcc-destructive-size-and-gcc-constructive-size>`_.643 644CUDA/HIP Language Changes645^^^^^^^^^^^^^^^^^^^^^^^^^646 647CUDA Support648^^^^^^^^^^^^649 650Support calling `consteval` function between different target.651 652AIX Support653^^^^^^^^^^^654 655NetBSD Support656^^^^^^^^^^^^^^657 658WebAssembly Support659^^^^^^^^^^^^^^^^^^^660 661- Fix a bug so that ``__has_attribute(musttail)`` is no longer true when WebAssembly's tail-call is not enabled. (#GH163256)662 663AVR Support664^^^^^^^^^^^665 666DWARF Support in Clang667----------------------668 669Floating Point Support in Clang670-------------------------------671 672Fixed Point Support in Clang673----------------------------674 675AST Matchers676------------677- Removed elaboratedType matchers, and related nested name specifier changes,678 following the corresponding changes in the clang AST.679- Ensure ``hasBitWidth`` doesn't crash on bit widths that are dependent on template680 parameters.681- Remove the ``dependentTemplateSpecializationType`` matcher, as the682 corresponding AST node was removed. This matcher was never very useful, since683 there was no way to match on its template name.684- Add a boolean member ``IgnoreSystemHeaders`` to ``MatchFinderOptions``. This685 allows it to ignore nodes in system headers when traversing the AST.686 687- ``hasConditionVariableStatement`` now supports ``for`` loop, ``while`` loop688 and ``switch`` statements.689- Fixed detection of explicit parameter lists in ``LambdaExpr``. (#GH168452)690- Added ``hasExplicitParameters`` for ``LambdaExpr`` as an output attribute to691 AST JSON dumps.692- Add ``arrayTypeLoc`` matcher for matching ``ArrayTypeLoc``.693 694clang-format695------------696- Add ``SpaceInEmptyBraces`` option and set it to ``Always`` for WebKit style.697- Add ``NumericLiteralCase`` option for enforcing character case in numeric698 literals.699- Add ``Leave`` suboption to ``IndentPPDirectives``.700- Add ``AllowBreakBeforeQtProperty`` option.701- Add ``BreakAfterOpenBracketBracedList'', ``BreakAfterOpenBracketFunction'',702 ``BreakAfterOpenBracketIf``, ``BreakAfterOpenBracketLoop``,703 ``BreakAfterOpenBracketSwitch``, ``BreakBeforeCloseBracketBracedList'',704 ``BreakBeforeCloseBracketFunction``, ``BreakBeforeCloseBracketIf``,705 ``BreakBeforeCloseBracketLoop``, ``BreakBeforeCloseBracketSwitch`` options.706- Deprecate ``AlwaysBreak`` and ``BlockIndent`` suboptions from the707 ``AlignAfterOpenBracket`` option, and make ``AlignAfterOpenBracket`` a708 ``bool`` type.709- Add ``AlignPPAndNotPP`` suboption to ``AlignTrailingComments``.710- Rename ``(Binary|Decimal|Hex)MinDigits`` to ``...MinDigitsInsert`` and add711 ``(Binary|Decimal|Hex)MaxDigitsSeparator`` suboptions to712 ``IntegerLiteralSeparator``.713 714libclang715--------716 717Code Completion718---------------719 720Static Analyzer721---------------722- The Clang Static Analyzer now handles parenthesized initialization.723 (#GH148875)724- ``__datasizeof`` (C++) and ``_Countof`` (C) no longer cause a failed assertion725 when given an operand of VLA type. (#GH151711)726 727New features728^^^^^^^^^^^^729 730Crash and bug fixes731^^^^^^^^^^^^^^^^^^^732- Fixed a crash in the static analyzer that when the expression in an733 ``[[assume(expr)]]`` attribute was enclosed in parentheses. (#GH151529)734- Fixed a crash when parsing ``#embed`` parameters with unmatched closing brackets. (#GH152829)735- Fixed a crash when compiling ``__real__`` or ``__imag__`` unary operator on scalar value with type promotion. (#GH160583)736 737Improvements738^^^^^^^^^^^^739 740Moved checkers741^^^^^^^^^^^^^^742 743.. _release-notes-sanitizers:744 745Sanitizers746----------747- Improved documentation for legacy ``no_sanitize`` attributes.748 749Python Binding Changes750----------------------751- Exposed ``clang_Cursor_isFunctionInlined``.752- Exposed ``clang_getCursorLanguage`` via ``Cursor.language``.753- Add all missing ``CursorKind``s, ``TypeKind``s and754 ``ExceptionSpecificationKind``s from ``Index.h``755 756OpenMP Support757--------------758- Added parsing and semantic analysis support for the ``need_device_addr``759 modifier in the ``adjust_args`` clause.760- Allow array length to be omitted in array section subscript expression.761- Fixed non-contiguous strided update in the ``omp target update`` directive with the ``from`` clause.762- Added support for threadset clause in task and taskloop directives.763- Properly handle array section/assumed-size array privatization in C/C++.764- Added support to handle new syntax of the ``uses_allocators`` clause.765- Added support for ``variable-category`` modifier in ``default clause``.766- Added support for ``defaultmap`` directive implicit-behavior ``storage``.767- Added support for ``defaultmap`` directive implicit-behavior ``private``.768- Added parsing and semantic analysis support for ``groupprivate`` directive.769- Added support for 'omp fuse' directive.770- Updated parsing and semantic analysis support for ``nowait`` clause to accept771 optional argument in OpenMP >= 60.772- Added support for ``default`` clause on ``target`` directive.773- Added parsing and semantic analysis support for ``need_device_ptr`` modifier774 to accept an optional fallback argument (``fb_nullify`` or ``fb_preserve``)775 with OpenMP >= 61.776 777Improvements778^^^^^^^^^^^^779 780Additional Information781======================782 783A wide variety of additional information is available on the `Clang web784page <https://clang.llvm.org/>`_. The web page contains versions of the785API documentation which are up-to-date with the Git version of786the source code. You can access versions of these documents specific to787this release by going into the "``clang/docs/``" directory in the Clang788tree.789 790If you have any questions or comments about Clang, please feel free to791contact us on the `Discourse forums (Clang Frontend category)792<https://discourse.llvm.org/c/clang/6>`_.793