Skip to content

Commit 7cdbb1e

Browse files
committed
release notes
1 parent 4871cd4 commit 7cdbb1e

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ C++ Specific Potentially Breaking Changes
147147
// Fixed version:
148148
unsigned operator""_udl_name(unsigned long long);
149149

150-
- Clang will now produce an error diagnostic when [[clang::lifetimebound]] is
150+
- Clang will now produce an error diagnostic when ``[[clang::lifetimebound]]`` is
151151
applied on a parameter or an implicit object parameter of a function that
152152
returns void. This was previously ignored and had no effect. (#GH107556)
153153

@@ -156,6 +156,21 @@ C++ Specific Potentially Breaking Changes
156156
// Now diagnoses with an error.
157157
void f(int& i [[clang::lifetimebound]]);
158158

159+
- Clang will now produce an error diagnostic when ``[[clang::lifetimebound]]``
160+
is applied on a type (instead of a function parameter or an implicit object
161+
parameter); this includes the case when the attribute is specified for an
162+
unnamed function parameter. These were previously ignored and had no effect.
163+
(#GH118281)
164+
165+
.. code-block:: c++
166+
167+
// Now diagnoses with an error.
168+
int* [[clang::lifetimebound]] x;
169+
// Now diagnoses with an error.
170+
void f(int* [[clang::lifetimebound]] i);
171+
// Now diagnoses with an error.
172+
void g(int* [[clang::lifetimebound]]);
173+
159174
- Clang now rejects all field accesses on null pointers in constant expressions. The following code
160175
used to work but will now be rejected:
161176

0 commit comments

Comments
 (0)