Index: clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/string =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/string +++ clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/string @@ -18,12 +18,15 @@ typedef basic_string _Type; basic_string(); basic_string(const C *p, const A &a = A()); + basic_string(const C *p, size_type count); ~basic_string(); const C *c_str() const; const C *data() const; + bool empty() const; + _Type& append(const C *s); _Type& append(const C *s, size_type n); _Type& assign(const C *s); @@ -72,6 +75,10 @@ bool operator==(const std::string&, const std::string&); bool operator==(const std::string&, const char*); bool operator==(const char*, const std::string&); + +bool operator!=(const std::string&, const std::string&); +bool operator!=(const std::string&, const char*); +bool operator!=(const char*, const std::string&); } #endif // _STRING_ Index: clang-tools-extra/test/clang-tidy/checkers/readability/string-compare.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/string-compare.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/string-compare.cpp @@ -1,25 +1,5 @@ -// RUN: %check_clang_tidy %s readability-string-compare %t - -namespace std { -template -class allocator {}; -template -class char_traits {}; -template , typename A = std::allocator> -class basic_string { -public: - basic_string(); - basic_string(const C *, unsigned int size); - int compare(const basic_string &str) const; - int compare(const C *) const; - int compare(int, int, const basic_string &str) const; - bool empty(); -}; -bool operator==(const basic_string &lhs, const basic_string &rhs); -bool operator!=(const basic_string &lhs, const basic_string &rhs); -bool operator==(const basic_string &lhs, const char *&rhs); -typedef basic_string string; -} +// RUN: %check_clang_tidy %s readability-string-compare %t -- -- -isystem %clang_tidy_headers +#include void func(bool b);