2022-02-01 23:13:01 -08:00
|
|
|
===========================================
|
|
|
|
Clang |release| |ReleaseNotesTitle|
|
|
|
|
===========================================
|
2020-02-13 22:46:33 +01:00
|
|
|
|
|
|
|
.. contents::
|
|
|
|
:local:
|
|
|
|
:depth: 2
|
|
|
|
|
|
|
|
Written by the `LLVM Team <https://llvm.org/>`_
|
|
|
|
|
2022-02-01 23:13:01 -08:00
|
|
|
.. only:: PreRelease
|
2020-02-13 22:46:33 +01:00
|
|
|
|
2022-02-01 23:13:01 -08:00
|
|
|
.. warning::
|
|
|
|
These are in-progress notes for the upcoming Clang |version| release.
|
|
|
|
Release notes for previous releases can be found on
|
|
|
|
`the Download Page <https://releases.llvm.org/download.html>`_.
|
2020-02-13 22:46:33 +01:00
|
|
|
|
|
|
|
Introduction
|
|
|
|
============
|
|
|
|
|
|
|
|
This document contains the release notes for the Clang C/C++/Objective-C
|
2022-02-01 23:13:01 -08:00
|
|
|
frontend, part of the LLVM Compiler Infrastructure, release |release|. Here we
|
2020-02-13 22:46:33 +01:00
|
|
|
describe the status of Clang in some detail, including major
|
|
|
|
improvements from the previous release and new feature work. For the
|
|
|
|
general LLVM release notes, see `the LLVM
|
|
|
|
documentation <https://llvm.org/docs/ReleaseNotes.html>`_. All LLVM
|
|
|
|
releases may be downloaded from the `LLVM releases web
|
|
|
|
site <https://llvm.org/releases/>`_.
|
|
|
|
|
|
|
|
For more information about Clang or LLVM, including information about the
|
|
|
|
latest release, please see the `Clang Web Site <https://clang.llvm.org>`_ or the
|
|
|
|
`LLVM Web Site <https://llvm.org>`_.
|
|
|
|
|
|
|
|
Note that if you are reading this file from a Git checkout or the
|
|
|
|
main Clang web page, this document applies to the *next* release, not
|
|
|
|
the current one. To see the release notes for a specific release, please
|
|
|
|
see the `releases page <https://llvm.org/releases/>`_.
|
|
|
|
|
2022-09-15 07:29:49 -04:00
|
|
|
Potentially Breaking Changes
|
|
|
|
============================
|
|
|
|
These changes are ones which we think may surprise users when upgrading to
|
|
|
|
Clang |release| because of the opportunity they pose for disruption to existing
|
|
|
|
code bases.
|
|
|
|
|
2022-02-01 23:13:01 -08:00
|
|
|
What's New in Clang |release|?
|
|
|
|
==============================
|
2020-02-13 22:46:33 +01:00
|
|
|
Some of the major new features and improvements to Clang are listed
|
|
|
|
here. Generic improvements to Clang as a whole or to its underlying
|
|
|
|
infrastructure are described first, followed by language-specific
|
|
|
|
sections with improvements to Clang's support for those languages.
|
|
|
|
|
|
|
|
Major New Features
|
|
|
|
------------------
|
|
|
|
|
2022-02-11 08:27:33 +01:00
|
|
|
Bug Fixes
|
2022-05-06 08:47:19 -04:00
|
|
|
---------
|
2023-01-25 10:47:21 -08:00
|
|
|
- Fix crash on invalid code when looking up a destructor in a templated class
|
|
|
|
inside a namespace. This fixes
|
|
|
|
`Issue 59446 <https://github.com/llvm/llvm-project/issues/59446>`_.
|
2023-01-30 13:26:02 -08:00
|
|
|
- Fix crash when diagnosing incorrect usage of ``_Nullable`` involving alias
|
|
|
|
templates. This fixes
|
|
|
|
`Issue 60344 <https://github.com/llvm/llvm-project/issues/60344>`_.
|
2022-03-12 20:49:01 +01:00
|
|
|
|
2020-02-13 22:46:33 +01:00
|
|
|
Improvements to Clang's diagnostics
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2023-01-31 09:33:06 -08:00
|
|
|
- We now generate a diagnostic for signed integer overflow due to unary minus
|
|
|
|
in a non-constant expression context. This fixes
|
|
|
|
`Issue 31643 <https://github.com/llvm/llvm-project/issues/31643>`_
|
2022-08-26 09:17:14 -04:00
|
|
|
|
2022-08-26 10:04:06 -04:00
|
|
|
Non-comprehensive list of changes in this release
|
|
|
|
-------------------------------------------------
|
2022-08-26 09:17:14 -04:00
|
|
|
|
2020-02-13 22:46:33 +01:00
|
|
|
New Compiler Flags
|
|
|
|
------------------
|
|
|
|
|
|
|
|
Deprecated Compiler Flags
|
|
|
|
-------------------------
|
|
|
|
|
|
|
|
Modified Compiler Flags
|
|
|
|
-----------------------
|
2023-01-23 13:25:55 +02:00
|
|
|
|
2020-12-17 09:23:02 -05:00
|
|
|
Removed Compiler Flags
|
|
|
|
-------------------------
|
|
|
|
|
2020-02-13 22:46:33 +01:00
|
|
|
New Pragmas in Clang
|
|
|
|
--------------------
|
|
|
|
- ...
|
|
|
|
|
|
|
|
Attribute Changes in Clang
|
|
|
|
--------------------------
|
2023-01-20 23:31:53 +00:00
|
|
|
|
2023-01-31 11:43:34 -08:00
|
|
|
Introduced a new function attribute ``__attribute__((unsafe_buffer_usage))``
|
|
|
|
to be worn by functions containing buffer operations that could cause out of
|
|
|
|
bounds memory accesses. It emits warnings at call sites to such functions when
|
|
|
|
the flag ``-Wunsafe-buffer-usage`` is enabled.
|
|
|
|
|
2020-02-13 22:46:33 +01:00
|
|
|
Windows Support
|
|
|
|
---------------
|
2023-01-23 13:25:55 +02:00
|
|
|
|
2022-05-02 17:06:04 -04:00
|
|
|
AIX Support
|
|
|
|
-----------
|
|
|
|
|
2020-02-13 22:46:33 +01:00
|
|
|
C Language Changes in Clang
|
|
|
|
---------------------------
|
2022-08-26 19:26:32 +08:00
|
|
|
|
2022-02-14 09:33:48 -05:00
|
|
|
C2x Feature Support
|
|
|
|
-------------------
|
2023-01-18 08:49:45 -05:00
|
|
|
|
2020-02-13 22:46:33 +01:00
|
|
|
C++ Language Changes in Clang
|
|
|
|
-----------------------------
|
2023-01-29 00:04:51 +00:00
|
|
|
- Improved ``-O0`` code generation for calls to ``std::forward_like``. Similarly to
|
|
|
|
``std::move, std::forward`` et al. it is now treated as a compiler builtin and implemented
|
|
|
|
directly rather than instantiating the definition from the standard library.
|
2022-08-11 12:53:41 -07:00
|
|
|
|
2021-04-14 04:18:23 -07:00
|
|
|
C++20 Feature Support
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^
|
2023-01-17 11:29:04 -08:00
|
|
|
|
2021-04-14 04:18:23 -07:00
|
|
|
C++2b Feature Support
|
2020-02-13 22:46:33 +01:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
2022-02-06 22:58:43 +01:00
|
|
|
- Implemented `P2036R3: Change scope of lambda trailing-return-type <https://wg21.link/P2036R3>`_
|
|
|
|
and `P2579R0 Mitigation strategies for P2036 <https://wg21.link/P2579R0>`_.
|
2023-01-31 11:19:30 +01:00
|
|
|
These proposals modify how variables captured in lambdas can appear in trailing return type
|
2022-02-06 22:58:43 +01:00
|
|
|
expressions and how their types are deduced therein, in all C++ language versions.
|
|
|
|
|
2022-05-03 14:13:56 -04:00
|
|
|
CUDA/HIP Language Changes in Clang
|
|
|
|
----------------------------------
|
|
|
|
|
2020-02-13 22:46:33 +01:00
|
|
|
Objective-C Language Changes in Clang
|
|
|
|
-------------------------------------
|
|
|
|
|
|
|
|
OpenCL C Language Changes in Clang
|
|
|
|
----------------------------------
|
|
|
|
|
|
|
|
...
|
|
|
|
|
|
|
|
ABI Changes in Clang
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
OpenMP Support in Clang
|
|
|
|
-----------------------
|
|
|
|
|
2022-04-19 08:45:51 -04:00
|
|
|
...
|
2022-02-02 13:06:55 -05:00
|
|
|
|
2020-02-13 22:46:33 +01:00
|
|
|
CUDA Support in Clang
|
|
|
|
---------------------
|
|
|
|
|
2023-01-17 20:53:58 +08:00
|
|
|
LoongArch Support in Clang
|
|
|
|
--------------------------
|
|
|
|
|
2022-08-18 14:39:37 -07:00
|
|
|
RISC-V Support in Clang
|
|
|
|
-----------------------
|
|
|
|
|
2020-08-20 21:37:51 +01:00
|
|
|
X86 Support in Clang
|
|
|
|
--------------------
|
2022-07-29 17:47:49 +08:00
|
|
|
|
2022-10-18 10:50:37 -07:00
|
|
|
WebAssembly Support in Clang
|
|
|
|
----------------------------
|
|
|
|
|
2022-01-23 20:45:25 -08:00
|
|
|
DWARF Support in Clang
|
|
|
|
----------------------
|
|
|
|
|
2021-10-15 14:29:57 +01:00
|
|
|
Arm and AArch64 Support in Clang
|
|
|
|
--------------------------------
|
[Clang][AArch64] Support AArch64 target(..) attribute formats.
This adds support under AArch64 for the target("..") attributes. The
current parsing is very X86-shaped, this patch attempts to bring it line
with the GCC implementation from
https://gcc.gnu.org/onlinedocs/gcc/AArch64-Function-Attributes.html#AArch64-Function-Attributes.
The supported formats are:
- "arch=<arch>" strings, that specify the architecture features for a
function as per the -march=arch+feature option.
- "cpu=<cpu>" strings, that specify the target-cpu and any implied
atributes as per the -mcpu=cpu+feature option.
- "tune=<cpu>" strings, that specify the tune-cpu cpu for a function as
per -mtune.
- "+<feature>", "+no<feature>" enables/disables the specific feature, for
compatibility with GCC target attributes.
- "<feature>", "no-<feature>" enabled/disables the specific feature, for
backward compatibility with previous releases.
To do this, the parsing of target attributes has been moved into
TargetInfo to give the target the opportunity to override the existing
parsing. The only non-aarch64 change should be a minor alteration to the
error message, specifying using "CPU" to describe the cpu, not
"architecture", and the DuplicateArch/Tune from ParsedTargetAttr have
been combined into a single option.
Differential Revision: https://reviews.llvm.org/D133848
2022-10-01 15:40:59 +01:00
|
|
|
|
2021-11-09 09:35:25 -05:00
|
|
|
Floating Point Support in Clang
|
|
|
|
-------------------------------
|
|
|
|
|
2020-02-13 22:46:33 +01:00
|
|
|
Internal API Changes
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
Build System Changes
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
AST Matchers
|
|
|
|
------------
|
|
|
|
|
|
|
|
clang-format
|
|
|
|
------------
|
|
|
|
|
2022-07-05 13:45:32 +02:00
|
|
|
clang-extdef-mapping
|
|
|
|
--------------------
|
|
|
|
|
2020-02-13 22:46:33 +01:00
|
|
|
libclang
|
|
|
|
--------
|
2022-08-25 08:35:46 +02:00
|
|
|
|
2020-02-13 22:46:33 +01:00
|
|
|
Static Analyzer
|
|
|
|
---------------
|
[analyzer] Consider single-elem arrays as FAMs by default
According to my measurement in https://reviews.llvm.org/D108230#3933232,
it seems like there is no drawback to enabling this analyzer-config by default.
Actually, enabling this by default would make it consistent with the
codegen of clang, which according to `-fstrict-flex-arrays`, assumes
by default that all trailing arrays could be FAMs, let them be of size
undefined, zero, one, or anything else.
Speaking of `-fstrict-flex-arrays`, in the next patch I'll deprecate
the analyzer-config FAM option in favor of that flag. That way, CSA will
always be in sync with what the codegen will think of FAMs.
So, if a new codebase sets `-fstrict-flex-arrays` to some value above 0,
CSA will also make sure that only arrays of the right size will be
considered as FAMs.
Reviewed By: xazax.hun
Differential Revision: https://reviews.llvm.org/D138657
2022-11-25 10:24:56 +01:00
|
|
|
|
2022-09-26 17:41:37 -07:00
|
|
|
.. _release-notes-sanitizers:
|
|
|
|
|
|
|
|
Sanitizers
|
|
|
|
----------
|
2020-02-13 22:46:33 +01:00
|
|
|
|
|
|
|
Core Analysis Improvements
|
|
|
|
==========================
|
|
|
|
|
|
|
|
- ...
|
|
|
|
|
|
|
|
New Issues Found
|
|
|
|
================
|
|
|
|
|
|
|
|
- ...
|
|
|
|
|
|
|
|
Python Binding Changes
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
The following methods have been added:
|
|
|
|
|
|
|
|
- ...
|
|
|
|
|
|
|
|
Significant Known Problems
|
|
|
|
==========================
|
|
|
|
|
|
|
|
Additional Information
|
|
|
|
======================
|
|
|
|
|
|
|
|
A wide variety of additional information is available on the `Clang web
|
|
|
|
page <https://clang.llvm.org/>`_. The web page contains versions of the
|
2020-03-22 22:18:40 +01:00
|
|
|
API documentation which are up-to-date with the Git version of
|
2020-02-13 22:46:33 +01:00
|
|
|
the source code. You can access versions of these documents specific to
|
|
|
|
this release by going into the "``clang/docs/``" directory in the Clang
|
|
|
|
tree.
|
|
|
|
|
|
|
|
If you have any questions or comments about Clang, please feel free to
|
2022-07-01 14:07:48 -07:00
|
|
|
contact us on the Discourse forums (Clang Frontend category)
|
|
|
|
<https://discourse.llvm.org/c/clang/6>`_.
|