File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments