Skip to content

Conversation

@ivafanas
Copy link
Contributor

No description provided.

@llvmbot llvmbot added the clang Clang issues not falling into any other category label Oct 15, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 15, 2025

@llvm/pr-subscribers-clang

Author: Afanasyev Ivan (ivafanas)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/163547.diff

1 Files Affected:

  • (modified) clang/docs/SafeBuffers.rst (+2-2)
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.

@ivafanas
Copy link
Contributor Author

@haoNoQ

Hi, could you please review the PR?

If it is ok, could you please merge it (I do not have commit access).

@ivafanas
Copy link
Contributor Author

Any update, please?

1 similar comment
@ivafanas
Copy link
Contributor Author

Any update, please?

@ivafanas
Copy link
Contributor Author

@zyn0217

Thank you. Could you please merge it?
I do not have commit access.

@zyn0217 zyn0217 merged commit 538c850 into llvm:main Oct 27, 2025
13 checks passed
@haoNoQ
Copy link
Collaborator

haoNoQ commented Oct 27, 2025

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.

dvbuka pushed a commit to dvbuka/llvm-project that referenced this pull request Oct 27, 2025
Lukacma pushed a commit to Lukacma/llvm-project that referenced this pull request Oct 29, 2025
aokblast pushed a commit to aokblast/llvm-project that referenced this pull request Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants