================
@@ -40,8 +40,10 @@ void ContainerDataPointerCheck::registerMatchers(MatchFinder 
*Finder) {
       cxxRecordDecl(
           unless(matchers::matchesAnyListedName(IgnoredContainers)),
           isSameOrDerivedFrom(
-              namedDecl(
-                  has(cxxMethodDecl(isPublic(), hasName("data")).bind("data")))
+              namedDecl(anyOf(has(cxxMethodDecl(isPublic(), hasName("c_str"))
+                                      .bind("c_str")),
+                              has(cxxMethodDecl(isPublic(), hasName("data"))
+                                      .bind("data"))))
----------------
5chmidti wrote:

The node bound to `data` is never retrieved, so you can remove the 
`.bind("data")`.

https://github.com/llvm/llvm-project/pull/71304
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to