1 ===========================================
2 Clang |release| |ReleaseNotesTitle|
3 ===========================================
9 Written by the `LLVM Team <https://llvm.org/>`_
14 These are in-progress notes for the upcoming Clang |version| release.
15 Release notes for previous releases can be found on
16 `the Download Page <https://releases.llvm.org/download.html>`_.
21 This document contains the release notes for the Clang C/C++/Objective-C
22 frontend, part of the LLVM Compiler Infrastructure, release |release|. Here we
23 describe the status of Clang in some detail, including major
24 improvements from the previous release and new feature work. For the
25 general LLVM release notes, see `the LLVM
26 documentation <https://llvm.org/docs/ReleaseNotes.html>`_. All LLVM
27 releases may be downloaded from the `LLVM releases web
28 site <https://llvm.org/releases/>`_.
30 For more information about Clang or LLVM, including information about the
31 latest release, please see the `Clang Web Site <https://clang.llvm.org>`_ or the
32 `LLVM Web Site <https://llvm.org>`_.
34 Note that if you are reading this file from a Git checkout or the
35 main Clang web page, this document applies to the *next* release, not
36 the current one. To see the release notes for a specific release, please
37 see the `releases page <https://llvm.org/releases/>`_.
39 What's New in Clang |release|?
40 ==============================
42 Some of the major new features and improvements to Clang are listed
43 here. Generic improvements to Clang as a whole or to its underlying
44 infrastructure are described first, followed by language-specific
45 sections with improvements to Clang's support for those languages.
52 - Fixes an accepts-invalid bug in C when using a ``_Noreturn`` function
53 specifier on something other than a function declaration. This fixes
54 `Issue 56800 <https://github.com/llvm/llvm-project/issues/56800>`_.
55 - Fix `#56772 <https://github.com/llvm/llvm-project/issues/56772>`_ - invalid
56 destructor names were incorrectly accepted on template classes.
57 - Improve compile-times with large dynamic array allocations with trivial
58 constructors. This fixes
59 `Issue 56774 <https://github.com/llvm/llvm-project/issues/56774>`_.
60 - No longer assert/miscompile when trying to make a vectorized ``_BitInt`` type
61 using the ``ext_vector_type`` attribute (the ``vector_size`` attribute was
62 already properly diagnosing this case).
63 - Fix clang not properly diagnosing the failing subexpression when chained
64 binary operators are used in a ``static_assert`` expression.
65 - Fix a crash when evaluating a multi-dimensional array's array filler
66 expression is element-dependent. This fixes
67 `Issue 50601 <https://github.com/llvm/llvm-project/issues/56016>`_.
68 - Fixed a crash-on-valid with consteval evaluation of a list-initialized
69 constructor for a temporary object. This fixes
70 `Issue 55871 <https://github.com/llvm/llvm-project/issues/55871>`_.
71 - Fix `#57008 <https://github.com/llvm/llvm-project/issues/57008>`_ - Builtin
72 C++ language extension type traits instantiated by a template with unexpected
73 number of arguments cause an assertion fault.
74 - Fix multi-level pack expansion of undeclared function parameters.
75 This fixes `Issue 56094 <https://github.com/llvm/llvm-project/issues/56094>`_.
76 - Fix `#57151 <https://github.com/llvm/llvm-project/issues/57151>`_.
77 ``-Wcomma`` is emitted for void returning functions.
78 - ``-Wtautological-compare`` missed warnings for tautological comparisons
79 involving a negative integer literal. This fixes
80 `Issue 42918 <https://github.com/llvm/llvm-project/issues/42918>`_.
82 Improvements to Clang's diagnostics
83 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84 - Clang will now correctly diagnose as ill-formed a constant expression where an
85 enum without a fixed underlying type is set to a value outside the range of
86 the enumeration's values. Due to the extended period of time this bug was
87 present in major C++ implementations (including Clang), this error has the
88 ability to be downgraded into a warning (via: -Wno-error=enum-constexpr-conversion)
89 to provide a transition period for users. This diagnostic is expected to turn
90 into an error-only diagnostic in the next Clang release. Fixes
91 `Issue 50055: <https://github.com/llvm/llvm-project/issues/50055>`_.
92 - Clang will now check compile-time determinable string literals as format strings.
93 Fixes `Issue 55805: <https://github.com/llvm/llvm-project/issues/55805>`_.
94 - ``-Wformat`` now recognizes ``%b`` for the ``printf``/``scanf`` family of
95 functions and ``%B`` for the ``printf`` family of functions. Fixes
96 `Issue 56885: <https://github.com/llvm/llvm-project/issues/56885>`_.
97 - ``-Wbitfield-constant-conversion`` now diagnoses implicit truncation when 1 is
98 assigned to a 1-bit signed integer bitfield. This fixes
99 `Issue 53253 <https://github.com/llvm/llvm-project/issues/53253>`_.
100 - ``-Wincompatible-function-pointer-types`` now defaults to an error in all C
101 language modes. It may be downgraded to a warning with
102 ``-Wno-error=incompatible-function-pointer-types`` or disabled entirely with
103 ``-Wno-implicit-function-pointer-types``.
104 - Clang will now print more information about failed static assertions. In
105 particular, simple static assertion expressions are evaluated to their
106 compile-time value and printed out if the assertion fails.
107 - Diagnostics about uninitialized ``constexpr`` varaibles have been improved
108 to mention the missing constant initializer.
110 Non-comprehensive list of changes in this release
111 -------------------------------------------------
116 Deprecated Compiler Flags
117 -------------------------
119 Modified Compiler Flags
120 -----------------------
122 Removed Compiler Flags
123 -------------------------
129 Attribute Changes in Clang
130 --------------------------
131 - Added support for ``__attribute__((guard(nocf)))`` and C++-style
132 ``[[clang::guard(nocf)]]``, which is equivalent to ``__declspec(guard(nocf))``
133 when using the MSVC environment. This is to support enabling Windows Control
134 Flow Guard checks with the ability to disable them for specific functions when
135 using the MinGW environment.
143 C Language Changes in Clang
144 ---------------------------
149 C++ Language Changes in Clang
150 -----------------------------
152 - Implemented DR692, DR1395 and DR1432. Use the ``-fclang-abi-compat=15`` option
153 to get the old partial ordering behavior regarding packs.
155 C++20 Feature Support
156 ^^^^^^^^^^^^^^^^^^^^^
158 - Support capturing structured bindings in lambdas
159 (`P1091R3 <https://wg21.link/p1091r3>`_ and `P1381R1 <https://wg21.link/P1381R1>`).
160 This fixes issues `GH52720 <https://github.com/llvm/llvm-project/issues/52720>`_,
161 `GH54300 <https://github.com/llvm/llvm-project/issues/54300>`_,
162 `GH54301 <https://github.com/llvm/llvm-project/issues/54301>`_,
163 and `GH49430 <https://github.com/llvm/llvm-project/issues/49430>`_.
164 - Consider explicitly defaulted constexpr/consteval special member function
165 template instantiation to be constexpr/consteval even though a call to such
166 a function cannot appear in a constant expression.
167 (C++14 [dcl.constexpr]p6 (CWG DR647/CWG DR1358))
168 - Correctly defer dependent immediate function invocations until template instantiation.
169 This fixes `GH55601 <https://github.com/llvm/llvm-project/issues/55601>`_.
170 - Implemented "Conditionally Trivial Special Member Functions" (`P0848 <https://wg21.link/p0848r3>`_).
171 Note: The handling of deleted functions is not yet compliant, as Clang
172 does not implement `DR1496 <https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1496>`_
173 and `DR1734 <https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1734>`_.
177 C++2b Feature Support
178 ^^^^^^^^^^^^^^^^^^^^^
180 CUDA/HIP Language Changes in Clang
181 ----------------------------------
183 Objective-C Language Changes in Clang
184 -------------------------------------
186 OpenCL C Language Changes in Clang
187 ----------------------------------
194 OpenMP Support in Clang
195 -----------------------
199 CUDA Support in Clang
200 ---------------------
204 RISC-V Support in Clang
205 -----------------------
207 - ``sifive-7-rv32`` and ``sifive-7-rv64`` are no longer supported for `-mcpu`.
208 Use `sifive-e76`, `sifive-s76`, or `sifive-u74` instead.
213 - Support ``-mindirect-branch-cs-prefix`` for call and jmp to indirect thunk.
215 DWARF Support in Clang
216 ----------------------
218 Arm and AArch64 Support in Clang
219 --------------------------------
221 Floating Point Support in Clang
222 -------------------------------
245 - Removed the deprecated ``-analyzer-store`` and
246 ``-analyzer-opt-analyze-nested-blocks`` analyzer flags.
247 ``scanbuild`` was also updated accordingly.
248 Passing these flags will result in a hard error.
250 .. _release-notes-ubsan:
252 Undefined Behavior Sanitizer (UBSan)
253 ------------------------------------
255 Core Analysis Improvements
256 ==========================
265 Python Binding Changes
266 ----------------------
268 The following methods have been added:
272 Significant Known Problems
273 ==========================
275 Additional Information
276 ======================
278 A wide variety of additional information is available on the `Clang web
279 page <https://clang.llvm.org/>`_. The web page contains versions of the
280 API documentation which are up-to-date with the Git version of
281 the source code. You can access versions of these documents specific to
282 this release by going into the "``clang/docs/``" directory in the Clang
285 If you have any questions or comments about Clang, please feel free to
286 contact us on the Discourse forums (Clang Frontend category)
287 <https://discourse.llvm.org/c/clang/6>`_.