-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[clang][docs] Fix typos in SafeBuffers.rst #163547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-clang Author: Afanasyev Ivan (ivafanas) ChangesFull diff: https://github.com/llvm/llvm-project/pull/163547.diff 1 Files Affected:
diff --git a/clang/docs/SafeBuffers.rst b/clang/docs/SafeBuffers.rst
index da75907e174a0..205e621e9d0eb 100644
--- a/clang/docs/SafeBuffers.rst
+++ b/clang/docs/SafeBuffers.rst
@@ -262,7 +262,7 @@ You can achieve this by refactoring the function to accept a ``std::span``
as a parameter::
int get_last_element(std::span<int> sp) {
- return sp[size - 1];
+ return sp[sp.size() - 1];
}
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
a "compatibility overload"::
int get_last_element(std::span<int> sp) {
- return sp[size - 1];
+ return sp[sp.size() - 1];
}
[[clang::unsafe_buffer_usage]] // Please use the new function.
|
|
Hi, could you please review the PR? If it is ok, could you please merge it (I do not have commit access). |
|
Any update, please? |
1 similar comment
|
Any update, please? |
|
Thank you. Could you please merge it? |
|
Hi, thank you so much! Yes your fixes are correct. I'm not actively working on this stuff anymore so I missed it sorry! @jkorous-apple was probably the correct person to take a look at this. |
No description provided.