[PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 28 09:10:36 PDT 2016


aaron.ballman added a subscriber: aaron.ballman.

================
Comment at: clang-tidy/readability/RedundantStringCStrCheck.cpp:129
@@ +128,3 @@
+  // Detect: 'dst += str.c_str()'  ->  'dst += str'
+  // Detect: 's == str.c_str()'  ->  's == str'
+  Finder->addMatcher(
----------------
I think this comment is incorrect, you want assignment, not equality.


http://reviews.llvm.org/D18475





More information about the cfe-commits mailing list