[PATCH] D17434: [Clang-tidy] Make readability-container-size-empty working with STL string

Eugene Zelenko via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 18 18:46:01 PST 2016


Eugene.Zelenko created this revision.
Eugene.Zelenko added reviewers: alexfh, xazax.hun, aaron.ballman.
Eugene.Zelenko added a subscriber: cfe-commits.
Eugene.Zelenko set the repository for this revision to rL LLVM.

While working with LLDB code I noticed that readability-container-size-empty doesn't detect problems with STL string, so this my attempt to fix problem.

Build and regressions were OK on RHEL 6.

Repository:
  rL LLVM

http://reviews.llvm.org/D17434

Files:
  clang-tidy/readability/ContainerSizeEmptyCheck.cpp

Index: clang-tidy/readability/ContainerSizeEmptyCheck.cpp
===================================================================
--- clang-tidy/readability/ContainerSizeEmptyCheck.cpp
+++ clang-tidy/readability/ContainerSizeEmptyCheck.cpp
@@ -16,6 +16,7 @@
 
 static bool isContainerName(llvm::StringRef ClassName) {
   static const char *const ContainerNames[] = {"array",
+                                               "basic_string",
                                                "deque",
                                                "forward_list",
                                                "list",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D17434.48448.patch
Type: text/x-patch
Size: 612 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160219/a61a47b2/attachment.bin>


More information about the cfe-commits mailing list