================ @@ -144,329 +208,411 @@ Resolutions to C++ Defect Reports C Language Changes ------------------ +- Implemented the ``defer`` draft Technical Specification + (`WG14 N3734 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3734.pdf>`_); it is enabled in C mode by + passing ``-fdefer-ts``. Note, the details of this feature are subject to change given that the Technical + Specification is not yet ratified. + C2y Feature Support ^^^^^^^^^^^^^^^^^^^ +- No longer triggering ``-Wstatic-in-inline`` in C2y mode; use of a static + function or variable within an extern inline function is no longer a + constraint per `WG14 N3622 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3622.txt>`_. +- Clang now supports `N3355 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm>`_ Named Loops. +- Clang's implementation of ``__COUNTER__`` was updated to conform to + `WG14 N3457 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3457.htm>`_. + This includes adding pedantic warnings for the feature being an extension in + other language modes as well as an error when the counter is expanded more + than 2147483647 times. C23 Feature Support ^^^^^^^^^^^^^^^^^^^ -- Clang now allows C23 ``constexpr`` struct member access through the dot operator in constant expressions. (#GH178349) - -Objective-C Language Changes ------------------------------ - -- Clang now emits Objective-C number, array, and dictionary literals as - compile-time constant data structures rather than runtime ``objc_msgSend`` - calls on targets whose runtime supports constant literal classes. The - feature can be disabled altogether with ``-fno-objc-constant-literals``, - or selectively per literal kind with ``-fno-constant-nsnumber-literals``, - ``-fno-constant-nsarray-literals``, and - ``-fno-constant-nsdictionary-literals``. +- Added ``FLT_SNAN``, ``DBL_SNAN``, and ``LDBL_SNAN`` to Clang's ``<float.h>`` + header in C23 and later modes. This implements + `WG14 N2710 <https://www.open-std.org/jtc1/sc22/wg14/www/docs/n2710.htm>`_. +- Fixed accepting as compatible unnamed tag types with the same fields within + the same translation unit but from different types. +- ``-MG`` now silences the "file not found" errors with ``#embed`` when + scanning for dependencies and encountering an unknown file. #GH165632 Non-comprehensive list of changes in this release ------------------------------------------------- +- Added ``__scoped_atomic_uinc_wrap`` and ``__scoped_atomic_udec_wrap``. + +- Removed OpenCL header-only feature macros (previously unconditionally enabled + on SPIR-V and only selectively disabled via ``-D__undef_<feature>``). All + OpenCL extensions and features are now centralized in OpenCLExtensions.def, + allowing consistent control via ``getSupportedOpenCLOpts`` and ``-cl-ext``. + +- Added ``__builtin_elementwise_ldexp``. + +- Added ``__builtin_elementwise_fshl`` and ``__builtin_elementwise_fshr``. + +- ``__builtin_elementwise_abs`` can now be used in constant expression. + +- Added ``__builtin_elementwise_minnumnum`` and ``__builtin_elementwise_maxnumnum``. + +- Trapping UBSan (e.g. ``-fsanitize=undefined -fsanitize-trap=undefined``) now + emits a string describing the reason for trapping into the generated debug + info. This feature allows debuggers (e.g. LLDB) to display the reason for + trapping if the trap is reached. The string is currently encoded in the debug + info as an artificial frame that claims to be inlined at the trap location. + The function used for the artificial frame is an artificial function whose + name encodes the reason for trapping. The encoding used is currently the same + as ``__builtin_verbose_trap`` but might change in the future. This feature is + enabled by default but can be disabled by compiling with + ``-fno-sanitize-debug-trap-reasons``. The feature has a ``basic`` and + ``detailed`` mode (the default). The ``basic`` mode emits a hard-coded string + per trap kind (e.g. ``Integer addition overflowed``) and the ``detailed`` mode + emits a more descriptive string describing each individual trap (e.g. ``signed + integer addition overflow in 'a + b'``). The ``detailed`` mode produces larger + debug info than ``basic`` but is more helpful for debugging. The + ``-fsanitize-debug-trap-reasons=`` flag can be used to switch between the + different modes or disable the feature entirely. Note due to trap merging in + optimized builds (i.e. in each function all traps of the same kind get merged + into the same trap instruction) the trap reasons might be removed. To prevent + this build without optimizations (i.e. use `-O0` or use the `optnone` function + attribute) or use the `fno-sanitize-merge=` flag in optimized builds. + +- ``__builtin_elementwise_max`` and ``__builtin_elementwise_min`` functions for integer types can + now be used in constant expressions. + +- A vector of booleans is now a valid condition for the ternary ``?:`` operator. + This binds to a simple vector select operation. + +- Added ``__builtin_masked_load``, ``__builtin_masked_expand_load``, + ``__builtin_masked_store``, ``__builtin_masked_compress_store`` for + conditional memory loads from vectors. Binds to the LLVM intrinsics of the + same name. + +- Added ``__builtin_masked_gather`` and ``__builtin_masked_scatter`` for + conditional gathering and scattering operations on vectors. Binds to the LLVM + intrinsics of the same name. + +- The ``__builtin_popcountg``, ``__builtin_ctzg``, and ``__builtin_clzg`` + functions now accept fixed-size boolean vectors. + +- Use of ``__has_feature`` to detect the ``ptrauth_qualifier`` and ``ptrauth_intrinsics`` + features has been deprecated, and is restricted to the arm64e target only. The + correct method to check for these features is to test for the ``__PTRAUTH__`` + macro. + +- Added a new builtin, ``__builtin_dedup_pack``, to remove duplicate types from a parameter pack. + This feature is particularly useful in template metaprogramming for normalizing type lists. + The builtin produces a new, unexpanded parameter pack that can be used in contexts like template + argument lists or base specifiers. + + .. code-block:: c++ + + template <typename...> struct TypeList; + + // The resulting type is TypeList<int, double, char> + using MyTypeList = TypeList<__builtin_dedup_pack<int, double, int, char, double>...>; -- Added support for floating point and pointer values in most ``__atomic_`` - builtins. + Currently, the use of ``__builtin_dedup_pack`` is limited to template arguments and base + specifiers, it also must be used within a template context. -- Added ``__builtin_stdc_rotate_left`` and ``__builtin_stdc_rotate_right`` - for bit rotation of unsigned integers including ``_BitInt`` types. 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. +- ``__builtin_assume_dereferenceable`` now accepts non-constant size operands. -- A new generic bit-reverse builtin function ``__builtin_bitreverseg`` that - extends bit-reversal support to all standard integers type, including - ``_BitInt`` +- Fixed a crash when the second argument to ``__builtin_assume_aligned`` was not constant (#GH161314) -- Deprecated float types support from ``__builtin_elementwise_max`` and - ``__builtin_elementwise_min``. +- Introduce support for :doc:`allocation tokens <AllocToken>` to enable + allocator-level heap organization strategies. A feature to instrument all + allocation functions with a token ID can be enabled via the + ``-fsanitize=alloc-token`` flag. + +- A new generic byte swap builtin function ``__builtin_bswapg`` that extends the existing + __builtin_bswap{16,32,64} function family to support all standard integer types. -- Added header ``endian.h`` which contains byte order helpers specified in POSIX +- A builtin ``__builtin_infer_alloc_token(<args>, ...)`` is provided to allow + compile-time querying of allocation token IDs, where the builtin arguments + mirror those normally passed to an allocation function. -- Added #pragma loop licm(disable) for llvm.loop.licm.disable metadata +- Clang now rejects the invalid use of ``constexpr`` with ``auto`` and an explicit type in C. (#GH163090) New Compiler Flags ------------------ -- New option ``-fms-anonymous-structs`` / ``-fno-ms-anonymous-structs`` added - to enable or disable Microsoft's anonymous struct/union extension without - enabling other ``-fms-extensions`` features (#GH177607). -- New option ``--precompile-reduced-bmi`` allows build system to generate a - reduced BMI only for a C++20 importable module unit. Previously the users - can only generate the reduced BMI as a by-product, e.g, an object files or - a full BMI. - -- New ``-cc1`` option ``-fexperimental-overflow-behavior-types`` added to - enable parsing of the experimental ``overflow_behavior`` type attribute and - type specifiers. - -- New ``-cl`` option ``/d2guardnochecks`` added to match MSVC. When Windows - Control Flow Guard (CFG) is enabled by other options, it will instruct Clang - to emit the CFG metadata, but disable adding checks. - -- New option ``-fdiagnostics-show-inlining-chain`` added to show inlining chain - notes for ``[[gnu::warning]]`` and ``[[gnu::error]]`` diagnostics. When a - function with these attributes is called from an inlined context, Clang can - now show which functions were inlined to reach the call. When debug info is - available (``-gline-directives-only`` (implicitly enabled at ``-g1``) or - higher), accurate source locations are used; otherwise, a heuristic fallback - is used with a note suggesting how to enable debug info for better accuracy. +- 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``). +- 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``). +- New options for enabling allocation token instrumentation: ``-fsanitize=alloc-token``, ``-falloc-token-max=``, ``-fsanitize-alloc-token-fast-abi``, ``-fsanitize-alloc-token-extended``. +- The ``-resource-dir`` option is now displayed in the list of options shown by ``--help``. +- New option ``-fmatrix-memory-layout`` added to control the memory layout of Clang matrix types. (e.g. ``-fmatrix-memory-layout=column-major`` or ``-fmatrix-memory-layout=row-major``). + +Lanai Support +^^^^^^^^^^^^^^ +- The option ``-mcmodel={small,medium,large}`` is supported again. Deprecated Compiler Flags ------------------------- Modified Compiler Flags ----------------------- -- The `-mno-outline` and `-moutline` compiler flags are now allowed on RISC-V and X86, which both support the machine outliner. -- The `-mno-outline` flag will now add the `nooutline` IR attribute, so that - `-mno-outline` and `-moutline` objects can be mixed correctly during LTO. +- The `-gkey-instructions` compiler flag is now enabled by default when DWARF is emitted for plain C/C++ and optimizations are enabled. (#GH149509) +- The `-fconstexpr-steps` compiler flag now accepts value `0` to opt out of this limit. (#GH160440) +- The `-fdevirtualize-speculatively` compiler flag is now supported to enable speculative devirtualization of virtual function calls, it's disabled by default. (#GH159685) Removed Compiler Flags ----------------------- +------------------------- Attribute Changes in Clang -------------------------- +- The definition of a function declaration with ``[[clang::cfi_unchecked_callee]]`` inherits this + attribute, allowing the attribute to only be attached to the declaration. Prior, this would be + treated as an error where the definition and declaration would have differing types. -- Added new attribute ``stack_protector_ignore`` to 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. - -- Added a new attribute, ``[[clang::no_outline]]`` to suppress outlining from - annotated functions. This uses the LLVM `nooutline` attribute. - -- Introduced a new type attribute ``__attribute__((overflow_behavior))`` which - currently accepts either ``wrap`` or ``trap`` as an argument, enabling - type-level control over overflow behavior. There is also an accompanying type - specifier for each behavior kind via `__ob_wrap` and `__ob_trap`. - -- Introduced a new function attribute ``__attribute__((__personality__(...)))`` - to explicitly specify the personality routine for exception handling. THis is - meant to be a low level tool for language runtime authors to associate a - foreign language personality with a given function. Note that this does not - perform any ABI validation for the personality routine. - -- The :doc:`ThreadSafetyAnalysis` attributes ``guarded_by`` and - ``pt_guarded_by`` now accept multiple capability arguments with refined - access semantics: *writing* requires all listed capabilities to be held - exclusively, while *reading* requires at least one to be held. This is - sound because any writer must hold all capabilities, so holding any one - prevents concurrent writes. - -- Added support for ``[[msvc::forceinline]]`` for functions and - ``[[msvc::forceinline_calls]]`` for statements. Both are aliases to - ``[[clang::always_inline]]`` with additional checks to ensure that they - are only accepted in places where MSVC also does. - -Improvements to Clang's diagnostics ------------------------------------ -- ``-Wunused-but-set-variable`` now diagnoses file-scope variables with - internal linkage (``static`` storage class) that are assigned but never used. - This new coverage is added under the subgroup ``-Wunused-but-set-global``, - allowing it to be disabled independently with ``-Wno-unused-but-set-global``. - (#GH148361) - -- Added ``-Wlifetime-safety`` to enable lifetime safety analysis, - a CFG-based intra-procedural analysis that detects use-after-free and related - temporal safety bugs. See the - `RFC <https://discourse.llvm.org/t/rfc-intra-procedural-lifetime-analysis-in-clang/86291>`_ - for more details. By design, this warning is enabled in ``-Weverything``. To disable - the analysis, use ``-Wno-lifetime-safety`` or ``-fno-lifetime-safety``. - -- Added ``-Wlifetime-safety-suggestions`` to 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: - - .. code-block:: c++ - - int* p(int *in) { return in; } - - Clang will suggest: - - .. code-block:: c++ - - 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-noescape`` to detect misuse of ``[[clang::noescape]]`` - annotation where the parameter escapes through return. For example: - - .. code-block:: c++ - - int* p(int *in [[clang::noescape]]) { return in; } - - Clang will warn: - - .. code-block:: c++ - - 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-field`` to detect dangling field references - when stack memory escapes to class fields. This is part of ``-Wlifetime-safety`` - and detects cases where local variables or parameters are stored in fields but - outlive their scope. For example: - - .. code-block:: c++ - - struct DanglingView { - std::string_view view; - DanglingView(std::string s) : view(s) {} // warning: address of stack memory escapes to a field - }; - -- Improved ``-Wassign-enum`` performance by caching enum enumerator values. (#GH176454) - -- Fixed a false negative in ``-Warray-bounds`` where the warning was suppressed - when accessing a member function on a past-the-end array element. - (#GH179128) - -- Added a missing space to the FixIt for the ``implicit-int`` group of diagnostics and - made sure that only one such diagnostic and FixIt is emitted per declaration group. (#GH179354) +- New format attributes ``gnu_printf``, ``gnu_scanf``, ``gnu_strftime`` and ``gnu_strfmon`` are added + as aliases for ``printf``, ``scanf``, ``strftime`` and ``strfmon``. (#GH16219) -- Fixed the Fix-It insertion point for ``expected ';' after alias declaration`` - when parsing alias declarations involving a token-split ``>>`` sequence - (for example, ``using A = X<int>>;``). (#GH184425) +- New function attribute `malloc_span` is added. It has semantics similar to that of the `malloc` + attribute, but `malloc_span` applies not to functions returning pointers, but to functions returning + span-like structures (i.e. those that contain a pointer field and a size integer field or two pointers). -- Fixed incorrect ``implicitly deleted`` diagnostic for explicitly deleted - candidate function. (#GH185693) +- Added new attribute ``modular_format`` to allow dynamically selecting at link + time which aspects of a statically linked libc's printf (et al) + implementation are required. This can reduce code size without requiring e.g. + multilibs for printf features. Requires cooperation with the libc + implementation. -- The ``-Wloop-analysis`` warning has been extended to catch more cases of - variable modification inside lambda expressions (#GH132038). - -- Clang now emits ``-Wsizeof-pointer-memaccess`` when snprintf/vsnprintf use the sizeof - the destination buffer(dynamically allocated) in the len parameter(#GH162366) - -- Added ``-Wmodule-map-path-outside-directory`` (off by default) to warn on - header and umbrella directory paths that use ``..`` to refer outside the module - directory in module maps found via implicit search - (``-fimplicit-module-maps``). This does not affect module maps specified - explicitly via ``-fmodule-map-file=``. - -- Honour ``[[maybe_unused]]`` attribute on private fields. - ``-Wunused-private-field`` no longer emits a warning for annotated private - fields. - -- Improved ``-Wgnu-zero-variadic-macro-arguments`` to suggest using - ``__VA_OPT__`` if the current language version supports it(#GH188624) - -- Clang now emits an error when implicitly casting a complex type to a built-in vector type. (#GH186805) +Improvements to Clang's diagnostics +----------------------------------- +- Diagnostics messages now refer to ``structured binding`` instead of ``decomposition``, + to align with `P0615R0 <https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0615r0.html>`_ changing the term. (#GH157880) +- Clang now suppresses runtime behavior warnings for unreachable code in file-scope + variable initializers, matching the behavior for functions. This prevents false + positives for operations in unreachable branches of constant expressions. +- Added a separate diagnostic group ``-Wfunction-effect-redeclarations``, for the more pedantic + diagnostics for function effects (``[[clang::nonblocking]]`` and ``[[clang::nonallocating]]``). + Moved the warning for a missing (though implied) attribute on a redeclaration into this group. + Added a new warning in this group for the case where the attribute is missing/implicit on + an override of a virtual method. +- Remove ``-Wperf-constraint-implies-noexcept`` from ``-Wall``. This warning is somewhat nit-picky and + attempts to resolve it, by adding ``noexcept``, can create new ways for programs to crash. (#GH167540) +- Implemented diagnostics when retrieving the tuple size for types where its specialization of `std::tuple_size` + produces an invalid size (either negative or greater than the implementation limit). (#GH159563) +- Fixed fix-it hint for fold expressions. Clang now correctly places the suggested right + parenthesis when diagnosing malformed fold expressions. (#GH151787) +- Added fix-it hint for when scoped enumerations require explicit conversions for binary operations. (#GH24265) +- Constant template parameters are now type checked in template definitions, + including template template parameters. +- Fixed an issue where emitted format-signedness diagnostics were not associated with an appropriate + diagnostic id. Besides being incorrect from an API standpoint, this was user visible, e.g.: + "format specifies type 'unsigned int' but the argument has type 'int' [-Wformat]" + "signedness of format specifier 'u' is incompatible with 'c' [-Wformat]" + This was misleading, because even though -Wformat is required in order to emit the diagnostics, + the warning flag the user needs to concerned with here is -Wformat-signedness, which is also + required and is not enabled by default. With the change you'll now see: + "format specifies type 'unsigned int' but the argument has type 'int', which differs in signedness [-Wformat-signedness]" + "signedness of format specifier 'u' is incompatible with 'c' [-Wformat-signedness]" + and the API-visible diagnostic id will be appropriate. +- Clang now produces better diagnostics for template template parameter matching + involving 'auto' template parameters. +- Fixed false positives in ``-Waddress-of-packed-member`` diagnostics when + potential misaligned members get processed before they can get discarded. + (#GH144729) +- Fix a false positive warning in ``-Wignored-qualifiers`` when the return type is undeduced. (#GH43054) + +- Clang now emits a diagnostic with the correct message in case of assigning to const reference captured in lambda. (#GH105647) + +- Fixed false positive in ``-Wmissing-noreturn`` diagnostic when it was requiring the usage of + ``[[noreturn]]`` on lambdas before C++23 (#GH154493). + +- Clang now diagnoses the use of ``#`` and ``##`` preprocessor tokens in + attribute argument lists in C++ when ``-pedantic`` is enabled. The operators + can be used in macro replacement lists with the usual preprocessor semantics, + however, non-preprocessor use of tokens now triggers a pedantic warning in C++. + Compilation in C mode is unchanged, and still permits these tokens to be used. (#GH147217) + +- Clang now diagnoses misplaced array bounds on declarators for template + specializations in th same way as it already did for other declarators. + (#GH147333) + +- A new warning ``-Walloc-size`` has been added to detect calls to functions + decorated with the ``alloc_size`` attribute don't allocate enough space for + the target pointer type. + +- The :doc:`ThreadSafetyAnalysis` attributes ``ACQUIRED_BEFORE(...)`` and + ``ACQUIRED_AFTER(...)`` have been moved to the stable feature set and no + longer require ``-Wthread-safety-beta`` to be used. +- The :doc:`ThreadSafetyAnalysis` gains basic alias-analysis of capability + pointers under ``-Wthread-safety-beta`` (still experimental), which reduces + both false positives but also false negatives through more precise analysis. + +- Clang now looks through parenthesis for ``-Wundefined-reinterpret-cast`` diagnostic. + +- Fixed a bug where the source location was missing when diagnosing ill-formed + placeholder constraints. + +- The two-element, unary mask variant of ``__builtin_shufflevector`` is now + properly being rejected when used at compile-time. It was not implemented + and caused assertion failures before (#GH158471). + +- Closed a loophole in the diagnosis of function pointer conversions changing + extended function type information in C mode (#GH41465). Function conversions + that were previously incorrectly accepted in case of other irrelevant + conditions are now consistently diagnosed, identical to C++ mode. + +- Fix false-positive unused label diagnostic when a label is used in a named break + or continue (#GH166013) +- Clang now emits a diagnostic in case `vector_size` or `ext_vector_type` + attributes are used with a negative size (#GH165463). +- Clang no longer emits ``-Wmissing-noreturn`` for virtual methods where + the function body consists of a `throw` expression (#GH167247). + +- A new warning ``-Wenum-compare-typo`` has been added to detect potential erroneous + comparison operators when mixed with bitwise operators in enum value initializers. + This can be locally disabled by explicitly casting the initializer value. +- Clang now provides correct caret placement when attributes appear before + `enum class` (#GH163224). + +- A new warning ``-Wshadow-header`` has been added to detect when a header file + is found in multiple search directories (excluding system paths). + +- Clang now detects potential missing format and format_matches attributes on function, + Objective-C method and block declarations when calling format functions. It is part + of the format-nonliteral diagnostic (#GH60718) + +- Fixed a crash when enabling ``-fdiagnostics-format=sarif`` and the output + carries messages like 'In file included from ...' or 'In module ...'. + Now the include/import locations are written into `sarif.run.result.relatedLocations`. Improvements to Clang's time-trace ---------------------------------- Improvements to Coverage Mapping -------------------------------- -- [MC/DC] Nested expressions are handled as individual MC/DC expressions. -- "Single byte coverage" now supports branch coverage and can be used - together with ``-fcoverage-mcdc``. - Bug Fixes in This Version ------------------------- - -- Fixed atomic boolean compound assignment; the conversion back to atomic bool would be miscompiled. (#GH33210) - -- Fixed a failed assertion in the preprocessor when ``__has_embed`` parameters are missing parentheses. (#GH175088) -- Fix lifetime extension of temporaries in for-range-initializers in templates. (#GH165182) -- Fixed a preprocessor crash in ``__has_cpp_attribute`` on incomplete scoped attributes. (#GH178098) -- Fixes an assertion failure when evaluating ``__underlying_type`` on enum redeclarations. (#GH177943) -- Fixed an assertion failure caused by nested macro expansion during header-name lexing (``__has_embed(__has_include)``). (#GH178635) -- Clang now outputs relative paths of embeds for dependency output. (#GH161950) -- Fix the result type of a binary operation where both operands are 'void' l-values. (#GH111300) -- Fixed an assertion failure when evaluating ``_Countof`` on invalid ``void``-typed operands. (#GH180893) -- Fixed an assertion failure in the serialized diagnostic printer when it is destroyed without calling ``finish()``. (#GH140433) -- Fixed an assertion failure caused by error recovery while extending a nested name specifier with results from ordinary lookup. (#GH181470) -- Fixed a crash when parsing ``#pragma clang attribute`` arguments for attributes that forbid arguments. (#GH182122) -- Fixed a bug with multiple-include optimization (MIOpt) state not being preserved in some cases during lexing, which could suppress header-guard mismatch diagnostics and interfere with include-guard optimization. (#GH180155) -- Fixed a crash when normalizing constraints involving concept template parameters whose index coincided with non-concept template parameters in the same parameter mapping. -- Fixed a crash caused by accessing dependent diagnostics of a non-dependent context. -- Fixed a crash when substituting into a non-type template parameter that has a type containing an undeduced placeholder type. -- Fixed several crashes and improved diagnostics when a multidimensional subscript operator is applied to a built-in type. (#GH187800) -- Correctly diagnosing and no longer crashing when ``export module foo`` - (without a semicolon) are the final tokens in a module file. (#GH187771) -- Fixed a crash in duplicate attribute checking caused by comparing constant arguments with different integer signedness. (#GH188259) -- Clang now emits an error when returning an initializer list from a lambda - with an explicit return type of void. The diagnostic now correctly refers - to "lambda" instead of "block". (#GH188661) -- Fixed a crash on _BitInt(N) arrays where 129 ≤ N ≤ 192 due to incorrect array filler lowering. (#GH189643) -- Fixed the behavior in C23 of ``auto``, by emitting an error when an array type is specified for a ``char *``. (#GH162694) +- Fix a crash when marco name is empty in ``#pragma push_macro("")`` or + ``#pragma pop_macro("")``. (#GH149762). +- Fix a crash in variable length array (e.g. ``int a[*]``) function parameter type + being used in ``_Countof`` expression. (#GH152826). +- ``-Wunreachable-code`` now diagnoses tautological or contradictory + comparisons such as ``x != 0 || x != 1.0`` and ``x == 0 && x == 1.0`` on + targets that treat ``_Float16``/``__fp16`` as native scalar types. Previously + the warning was silently lost because the operands differed only by an implicit + cast chain. (#GH149967). +- Fix crash in ``__builtin_function_start`` by checking for invalid + first parameter. (#GH113323). +- Fixed a crash with incompatible pointer to integer conversions in designated + initializers involving string literals. (#GH154046) +- Fix crash on CTAD for alias template. (#GH131342), (#GH131408) +- Clang now emits a frontend error when a function marked with the `flatten` attribute + calls another function that requires target features not enabled in the caller. This + prevents a fatal error in the backend. +- Fixed scope of typedefs present inside a template class. (#GH91451) +- Builtin elementwise operators now accept vector arguments that have different + qualifiers on their elements. For example, vector of 4 ``const float`` values + and vector of 4 ``float`` values. (#GH155405) +- Fixed inconsistent shadow warnings for lambda capture of structured bindings. + Previously, ``[val = val]`` (regular parameter) produced no warnings with ``-Wshadow`` + while ``[a = a]`` (where ``a`` is from ``auto [a, b] = std::make_pair(1, 2)``) + incorrectly produced warnings. Both cases now consistently show no warnings with + ``-Wshadow`` and show uncaptured-local warnings with ``-Wshadow-all``. (#GH68605) +- Fixed a failed assertion with a negative limit parameter value inside of + ``__has_embed``. (#GH157842) +- Fixed an assertion when an improper use of the ``malloc`` attribute targeting + a function without arguments caused us to try to access a non-existent argument. + (#GH159080) +- Fixed a failed assertion with empty filename arguments in ``__has_embed``. (#GH159898) +- Fixed a failed assertion with empty filename in ``#embed`` directive. (#GH162951) +- Fixed a crash triggered by unterminated ``__has_embed``. (#GH162953) +- Accept empty enumerations in MSVC-compatible C mode. (#GH114402) +- Fix a bug leading to incorrect code generation with complex number compound assignment and bitfield values, which also caused a crash with UBsan. (#GH166798) +- Fixed false-positive shadow diagnostics for lambdas in explicit object member functions. (#GH163731) +- Fix an assertion failure when a ``target_clones`` attribute is only on the + forward declaration of a multiversioned function. (#GH165517) (#GH129483) Bug Fixes to Compiler Builtins ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- Fix a crash when passing an unresolved overload set to ``__builtin_classify_type``. (#GH175589) -- Fixed a crash when calling `__builtin_allow_sanitize_check` with no arguments. (#GH183927) +- Fix an ambiguous reference to the builtin `type_info` (available when using + `-fms-compatibility`) with modules. (#GH38400) Bug Fixes to Attribute Support ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -- Fixed a behavioral discrepancy between deleted functions and private members when checking the ``enable_if`` attribute. (#GH175895) -- Fixed ``init_priority`` attribute by delaying type checks until after the type is deduced. + +- ``[[nodiscard]]`` is now respected on Objective-C and Objective-C++ methods + (#GH141504) and on types returned from indirect calls (#GH142453). +- Fixes some late parsed attributes, when applied to function definitions, not being parsed + in function try blocks, and some situations where parsing of the function body + is skipped, such as error recovery, code completion, and msvc-compatible delayed + template parsing. (#GH153551) +- Using ``[[gnu::cleanup(some_func)]]`` where some_func is annotated with + ``[[gnu::error("some error")]]`` now correctly triggers an error. (#GH146520) +- Fix a crash when the function name is empty in the `swift_name` attribute. (#GH157075) +- Fixes crashes or missing diagnostics with the `device_kernel` attribute. (#GH161905) +- Fix handling of parameter indexes when an attribute is applied to a C++23 explicit object member function. +- Fixed several false positives and false negatives in function effect (`nonblocking`) analysis. (#GH166078) (#GH166101) (#GH166110) +- Fix ``cleanup`` attribute by delaying type checks until after the type is deduced. (#GH129631) +- Fix a crash when instantiating a function template with ``constructor`` or ``destructor`` + attributes without a priority argument. (#GH169072) Bug Fixes to C++ Support ^^^^^^^^^^^^^^^^^^^^^^^^ -- Fixed a crash on error recovery when dealing with invalid templates. (#GH183075) -- Fixed a crash when instantiating ``requires`` expressions involving substitution failures in C++ concepts. (#GH176402) -- Fixed an incorrect template argument deduction when matching packs of template - template parameters when one of its parameters is also a pack. (#GH181166) -- Fixed a crash when a default argument is passed to an explicit object parameter. (#GH176639) -- Fixed an alias template CTAD crash. -- Fixed a crash when diagnosing an invalid static member function with an explicit object parameter (#GH177741) -- Fixed a crash when instantiating an invalid out-of-line static data member definition in a local class. (#GH176152) -- Fixed a crash when pack expansions are used as arguments for non-pack parameters of built-in templates. (#GH180307) -- Fixed a bug where captured variables in non-mutable lambdas were incorrectly treated as mutable - when used inside decltype in the return type. (#GH180460) -- Fixed a crash when evaluating uninitialized GCC vector/ext_vector_type vectors in ``constexpr``. (#GH180044) -- Fixed a crash when `explicit(bool)` is used with an incomplete enumeration. (#GH183887) -- Fixed a crash on ``typeid`` of incomplete local types during template instantiation. (#GH63242), (#GH176397) -- Fixed a crash when an immediate-invoked ``consteval`` lambda is used as an invalid initializer. (#GH185270) -- Fixed an assertion failure when using a global destructor with a target with a non-default program address space. (#GH186484) - -- Inherited constructors in ``dllexport`` classes are now exported for ABI-compatible cases, matching - MSVC behavior. Constructors with variadic arguments or callee-cleanup parameters are not yet supported - and produce a warning. (#GH162640) - -- Fix initialization of GRO when GRO-return type mismatches, as part of CWG2563. (#GH98744) -- Fix an error using an initializer list with array new for a type that is not default-constructible. (#GH81157) -- We no longer consider conversion operators when copy-initializing from the same type. This was non - conforming and could lead to recursive constraint satisfaction checking. (#GH149443) +- Clang now correctly diagnoses block pointer types as invalid for non-type template parameters. (#GH189247) ---------------- mizvekov wrote:
How about "Clang now rejects constant template parameters with block pointer types, since these are not implemented anyway and would lead to crashes. (#GH189247)" https://github.com/llvm/llvm-project/pull/190464 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
