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

Baranov Victor via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 30 09:20:50 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) {
----------------
vbvictor wrote:

Could we add test with templated function and `unique_ptr<T>`?

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


More information about the cfe-commits mailing list