[PATCH] D19577: [clang-tidy] Enhance misc-suspicious-string-compare by matching string.compare

Etienne Bergeron via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 26 19:53:14 PDT 2016


etienneb created this revision.
etienneb added a reviewer: alexfh.
etienneb added a subscriber: cfe-commits.

This patch added the support for method "compare" on string-like classes.

The LLVM stringRef is supported. The checker assume that StringRef is returning -1, 0 or 1.
Which is not the case for other functions returning <0, 0 or >0.

http://reviews.llvm.org/D19577

Files:
  clang-tidy/misc/SuspiciousStringCompareCheck.cpp
  test/clang-tidy/misc-suspicious-string-compare.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19577.55157.patch
Type: text/x-patch
Size: 7517 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160427/10672d7d/attachment-0001.bin>


More information about the cfe-commits mailing list