[clang-tools-extra] [clang-tidy] Fix `readability-container-data-pointer` check (PR #165636)

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 31 11:00:05 PDT 2025


================
@@ -144,3 +150,9 @@ int *r() {
   // CHECK-MESSAGES: :[[@LINE-1]]:10: warning: 'data' should be used for accessing the data pointer instead of taking the address of the 0-th element [readability-container-data-pointer]
   // CHECK-FIXES: return holder.v.data();
 }
+
+void s(std::unique_ptr<std::vector<unsigned char>> p) {
----------------
zeyi2 wrote:

Hi, thanks for reviewing. I've added a new test as requested :)

https://github.com/llvm/llvm-project/pull/165636


More information about the cfe-commits mailing list