================
@@ -25,11 +25,37 @@ void h() {
   // CHECK-FIXES-CLASSIC: f(s.data());
   // CHECK-MESSAGES-WITH-CONFIG-NOT: :[[@LINE-3]]:5: warning: 'data' should be 
used for accessing the data pointer instead of taking the address of the 0-th 
element [readability-container-data-pointer]
 
+  char* p1 = &s[0];
+  // CHECK-MESSAGES-CLASSIC: :[[@LINE-1]]:14: 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-CLASSIC: char* p1 = s.data();
+  // CHECK-MESSAGES-WITH-CONFIG-NOT: :[[@LINE-3]]:14: warning: 'data' should 
be used for accessing the data pointer instead of taking the address of the 
0-th element [readability-container-data-pointer]
+
+  const char* p2 = &s[0];
----------------
unterumarmung wrote:

Maybe `const auto*` test case also?

https://github.com/llvm/llvm-project/pull/190590
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to