mikecrowe created this revision. Herald added a subscriber: xazax.hun. Herald added a project: All. mikecrowe requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits.
This requires operator[] to be added to the std::basic_string implementation. https://reviews.llvm.org/D145310 Files: clang-tools-extra/test/clang-tidy/checkers/Inputs/Headers/string clang-tools-extra/test/clang-tidy/checkers/readability/container-data-pointer.cpp Index: clang-tools-extra/test/clang-tidy/checkers/readability/container-data-pointer.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/container-data-pointer.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/container-data-pointer.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s readability-container-data-pointer %t -- -- -fno-delayed-template-parsing +// RUN: %check_clang_tidy %s readability-container-data-pointer %t -- -- -isystem %clang_tidy_headers -fno-delayed-template-parsing +#include <string> typedef __SIZE_TYPE__ size_t; @@ -17,22 +18,6 @@ const T &operator[](size_type) const; }; -template <typename T> -struct basic_string { - using size_type = size_t; - - basic_string(); - - T *data(); - const T *data() const; - - T &operator[](size_t); - const T &operator[](size_type) const; -}; - -typedef basic_string<char> string; -typedef basic_string<wchar_t> wstring; - template <typename T> struct is_integral; 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 @@ -42,6 +42,9 @@ _Type& insert(size_type pos, const C* s); _Type& insert(size_type pos, const C* s, size_type n); + _Type& operator[](size_type); + const _Type& operator[](size_type) const; + _Type& operator+=(const _Type& str); _Type& operator+=(const C* s); _Type& operator=(const _Type& str);
Index: clang-tools-extra/test/clang-tidy/checkers/readability/container-data-pointer.cpp =================================================================== --- clang-tools-extra/test/clang-tidy/checkers/readability/container-data-pointer.cpp +++ clang-tools-extra/test/clang-tidy/checkers/readability/container-data-pointer.cpp @@ -1,4 +1,5 @@ -// RUN: %check_clang_tidy %s readability-container-data-pointer %t -- -- -fno-delayed-template-parsing +// RUN: %check_clang_tidy %s readability-container-data-pointer %t -- -- -isystem %clang_tidy_headers -fno-delayed-template-parsing +#include <string> typedef __SIZE_TYPE__ size_t; @@ -17,22 +18,6 @@ const T &operator[](size_type) const; }; -template <typename T> -struct basic_string { - using size_type = size_t; - - basic_string(); - - T *data(); - const T *data() const; - - T &operator[](size_t); - const T &operator[](size_type) const; -}; - -typedef basic_string<char> string; -typedef basic_string<wchar_t> wstring; - template <typename T> struct is_integral; 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 @@ -42,6 +42,9 @@ _Type& insert(size_type pos, const C* s); _Type& insert(size_type pos, const C* s, size_type n); + _Type& operator[](size_type); + const _Type& operator[](size_type) const; + _Type& operator+=(const _Type& str); _Type& operator+=(const C* s); _Type& operator=(const _Type& str);
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits