You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: clang/docs/ReleaseNotes.rst
+73-1Lines changed: 73 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,9 +49,36 @@ C++ Specific Potentially Breaking Changes
49
49
few users and can be written as ``__is_same(__remove_cv(T), decltype(nullptr))``,
50
50
which GCC supports as well.
51
51
52
+
- Clang will now correctly diagnose as ill-formed a constant expression where an
53
+
enum without a fixed underlying type is set to a value outside the range of
54
+
the enumeration's values.
55
+
56
+
.. code-block:: c++
57
+
58
+
enum E { Zero, One, Two, Three, Four };
59
+
constexpr E Val1 = (E)3; // Ok
60
+
constexpr E Val2 = (E)7; // Ok
61
+
constexpr E Val3 = (E)8; // Now ill-formed, out of the range [0, 7]
62
+
constexpr E Val4 = (E)-1; // Now ill-formed, out of the range [0, 7]
63
+
64
+
Since Clang 16, it has been possible to suppress the diagnostic via
65
+
`-Wno-enum-constexpr-conversion`, to allow for a transition period for users.
66
+
Now, in Clang 20, **it is no longer possible to suppress the diagnostic**.
67
+
68
+
- Extraneous template headers are now ill-formed by default.
69
+
This error can be disable with ``-Wno-error=extraneous-template-head``.
70
+
71
+
.. code-block:: c++
72
+
73
+
template <> // error: extraneous template head
74
+
template <typename T>
75
+
void f();
76
+
52
77
ABI Changes in This Version
53
78
---------------------------
54
79
80
+
- Fixed Microsoft name mangling of placeholder, auto and decltype(auto), return types for MSVC 1920+. This change resolves incompatibilities with code compiled by MSVC 1920+ but will introduce incompatibilities with code compiled by earlier versions of Clang unless such code is built with the compiler option -fms-compatibility-version=19.14 to imitate the MSVC 1914 mangling behavior.
81
+
55
82
AST Dumping Potentially Breaking Changes
56
83
----------------------------------------
57
84
@@ -95,6 +122,9 @@ C++23 Feature Support
95
122
C++2c Feature Support
96
123
^^^^^^^^^^^^^^^^^^^^^
97
124
125
+
- Add ``__builtin_is_implicit_lifetime`` intrinsic, which supports
126
+
`P2647R1 A trait for implicit lifetime types <https://wg21.link/p2674r1>`_
127
+
98
128
- Add ``__builtin_is_virtual_base_of`` intrinsic, which supports
99
129
`P2985R0 A type trait for detecting virtual base classes <https://wg21.link/p2985r0>`_
100
130
@@ -140,6 +170,11 @@ Modified Compiler Flags
140
170
Removed Compiler Flags
141
171
-------------------------
142
172
173
+
- The compiler flag `-Wenum-constexpr-conversion` (and the `Wno-`, `Wno-error-`
174
+
derivatives) is now removed, since it's no longer possible to suppress the
175
+
diagnostic (see above). Users can expect an `unknown warning` diagnostic if
176
+
it's still in use.
177
+
143
178
Attribute Changes in Clang
144
179
--------------------------
145
180
@@ -217,8 +252,10 @@ Bug Fixes to C++ Support
217
252
- Clang now preserves the unexpanded flag in a lambda transform used for pack expansion. (#GH56852), (#GH85667),
218
253
(#GH99877).
219
254
- Fixed a bug when diagnosing ambiguous explicit specializations of constrained member functions.
220
-
- Fixed an assertion failure when selecting a function from an overload set that includes a
255
+
- Fixed an assertion failure when selecting a function from an overload set that includes a
221
256
specialization of a conversion function template.
257
+
- Correctly diagnose attempts to use a concept name in its own definition;
258
+
A concept name is introduced to its scope sooner to match the C++ standard. (#GH55875)
222
259
223
260
Bug Fixes to AST Handling
224
261
^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -347,11 +384,46 @@ Improvements
347
384
Moved checkers
348
385
^^^^^^^^^^^^^^
349
386
387
+
- The checker ``alpha.security.MallocOverflow`` was deleted because it was
388
+
badly implemented and its agressive logic produced too many false positives.
389
+
To detect too large arguments passed to malloc, consider using the checker
390
+
``alpha.taint.TaintedAlloc``.
391
+
350
392
.. _release-notes-sanitizers:
351
393
352
394
Sanitizers
353
395
----------
354
396
397
+
- Added the ``-fsanitize-overflow-pattern-exclusion=`` flag which can be used
398
+
to disable specific overflow-dependent code patterns. The supported patterns
399
+
are: ``add-overflow-test``, ``negated-unsigned-const``, and
400
+
``post-decr-while``. The sanitizer instrumentation can be toggled off for all
401
+
available patterns by specifying ``all``. Conversely, you can disable all
402
+
exclusions with ``none``.
403
+
404
+
.. code-block:: c++
405
+
406
+
/// specified with ``-fsanitize-overflow-pattern-exclusion=add-overflow-test``
407
+
int common_overflow_check_pattern(unsigned base, unsigned offset) {
408
+
if (base + offset < base) { /* ... */ } // The pattern of `a + b < a`, and other re-orderings, won't be instrumented
409
+
}
410
+
411
+
/// specified with ``-fsanitize-overflow-pattern-exclusion=negated-unsigned-const``
412
+
void negation_overflow() {
413
+
unsigned long foo = -1UL; // No longer causes a negation overflow warning
414
+
unsigned long bar = -2UL; // and so on...
415
+
}
416
+
417
+
/// specified with ``-fsanitize-overflow-pattern-exclusion=post-decr-while``
418
+
void while_post_decrement() {
419
+
unsigned char count = 16;
420
+
while (count--) { /* ... */} // No longer causes unsigned-integer-overflow sanitizer to trip
421
+
}
422
+
423
+
Many existing projects have a large amount of these code patterns present.
424
+
This new flag should allow those projects to enable integer sanitizers with
425
+
less noise.
426
+
355
427
Python Binding Changes
356
428
----------------------
357
429
- Fixed an issue that led to crashes when calling ``Type.get_exception_specification_kind``.
0 commit comments