summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/readability-redundant-string-init.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Fix FP with readability-redundant-string-init for default argumentsEtienne Bergeron2016-04-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | Summary: Clang-tidy is reporting a warning of redundant string initialisation on a string parameter initialized with empty string. See bug: 27087 The reported example is: ``` #include <string> void fn(std::string a = ""); ``` Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18829 llvm-svn: 265671
* [clang-tidy] Fix redundant-string-init check with msvc 14 headers.Etienne Bergeron2016-03-221-0/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The string constructors are not defined using optional parameters and are not recognized by the redundant-string-init checker. The following patch fixes the redundant-string-init checker for the Visual Studio 14 headers file. The matcher now accept both variant (with 1 and 2 parameters). Also added new unittests. Similar issue than: [[ http://reviews.llvm.org/D18285 | review ]] In the xstring.h header, the constructors are defined this way: ``` basic_string(const _Myt& _Right) [...] basic_string(const _Myt& _Right, const _Alloc& _Al) [...] ``` Reviewers: alexfh, hokein Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18293 llvm-svn: 264069
* Add a new check, readability-redundant-string-init, that checks unnecessary ↵Alexander Kornienko2016-02-251-0/+86
string initializations. Reviewers: hokein, alexfh Subscribers: cfe-commits Patch by Shuai Wang! Differential Revision: http://reviews.llvm.org/D17586 llvm-svn: 261939
OpenPOWER on IntegriCloud