Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-30 Thread Richard via cfe-commits
LegalizeAdulthood added a subscriber: LegalizeAdulthood. LegalizeAdulthood added a comment. Can you summarize the improvements in `docs/ReleaseNotes.rst` please? http://reviews.llvm.org/D18475 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-29 Thread Etienne Bergeron via cfe-commits
etienneb marked an inline comment as done. etienneb added a comment. I'll to try to make a better way to describe redundant cases (as proposed by sbenza@) with an array. I like the array based approach, it's lean and clean. I'll try to make a prototype of the generic overloaded functions matcher

Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-29 Thread Samuel Benzaquen via cfe-commits
sbenza added a comment. In http://reviews.llvm.org/D18475#385789, @alexfh wrote: > Looks good to me. Adding Samuel, since he has done a lot of similar stuff by > now and might have good ideas on improving this and making this more general. There are two things I've done before that might apply

Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-29 Thread Alexander Kornienko via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. Looks good to me. Adding Samuel, since he has done a lot of similar stuff by now and might have good ideas on improving this and making this more general. http://reviews.llvm.org/D18475 __

Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-29 Thread Etienne Bergeron via cfe-commits
etienneb marked an inline comment as done. etienneb added a comment. thanks, aaron.ballman@. Comment at: clang-tidy/readability/RedundantStringCStrCheck.cpp:129 @@ +128,3 @@ + // Detect: 'dst += str.c_str()' -> 'dst += str' + // Detect: 's == str.c_str()' -> 's == str' +

Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-29 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 51927. etienneb added a comment. fix invalid comment. http://reviews.llvm.org/D18475 Files: clang-tidy/readability/RedundantStringCStrCheck.cpp test/clang-tidy/readability-redundant-string-cstr.cpp Index: test/clang-tidy/readability-redundant-string-c

Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-28 Thread Aaron Ballman via cfe-commits
aaron.ballman added a subscriber: aaron.ballman. Comment at: clang-tidy/readability/RedundantStringCStrCheck.cpp:129 @@ +128,3 @@ + // Detect: 'dst += str.c_str()' -> 'dst += str' + // Detect: 's == str.c_str()' -> 's == str' + Finder->addMatcher( I think t

Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-25 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 51664. etienneb updated the summary for this revision. etienneb added a comment. fix unittest on linux/32-bits. tested on windows/32-bits. http://reviews.llvm.org/D18475 Files: clang-tidy/readability/RedundantStringCStrCheck.cpp test/clang-tidy/readabi

Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-25 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. chapuni@: I would like to know why "-target x86_64-unknown -std=c++11" was needed. I'm fixing an issue with char16_t/char32_t. Is that the problem you just fixed? http://reviews.llvm.org/D18475 ___ cfe-commits mailing lis

Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-25 Thread Etienne Bergeron via cfe-commits
etienneb updated this revision to Diff 51657. etienneb added a comment. Fixing some matchers to use the recent new AstMatcher. (see http://reviews.llvm.org/D18275) http://reviews.llvm.org/D18475 Files: clang-tidy/readability/RedundantStringCStrCheck.cpp test/clang-tidy/readability-redundant

Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-25 Thread Etienne Bergeron via cfe-commits
etienneb added a comment. In http://reviews.llvm.org/D18475#383520, @Eugene.Zelenko wrote: > Thank you for enhancement! > > I think will be good idea to extend check for any function call that receives > .c_str(), since it mat be in other classes could have methods which receives > both C++ or

Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-25 Thread David Blaikie via cfe-commits
On Fri, Mar 25, 2016 at 9:59 AM, Etienne Bergeron via cfe-commits < cfe-commits@lists.llvm.org> wrote: > etienneb created this revision. > etienneb added a subscriber: cfe-commits. > > The string class contains methods which support receiving either a string > literal or a string object. > > For e

Re: [PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-25 Thread Eugene Zelenko via cfe-commits
Eugene.Zelenko added a subscriber: Eugene.Zelenko. Eugene.Zelenko added a comment. Thank you for enhancement! I think will be good idea to extend check for any function call that receives .c_str(), since it mat be in other classes could have methods which receives both C++ or C strings. See als

[PATCH] D18475: [clang-tidy] Add more detection rules for redundant c_str calls.

2016-03-25 Thread Etienne Bergeron via cfe-commits
etienneb created this revision. etienneb added a subscriber: cfe-commits. The string class contains methods which support receiving either a string literal or a string object. For example, calls to append can receive either a char* or a string. ``` string& append (const string& str); string&