We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7d7a856 commit 9c275a1Copy full SHA for 9c275a1
clang/docs/SafeBuffers.rst
@@ -262,7 +262,7 @@ You can achieve this by refactoring the function to accept a ``std::span``
262
as a parameter::
263
264
int get_last_element(std::span<int> sp) {
265
- return sp[size - 1];
+ return sp[sp.size() - 1];
266
}
267
268
This solution puts the responsibility for making sure the span is well-formed
@@ -411,7 +411,7 @@ backwards compatibility -- in terms of both API and ABI -- by adding
411
a "compatibility overload"::
412
413
414
415
416
417
[[clang::unsafe_buffer_usage]] // Please use the new function.
0 commit comments