Re: [PATCH] D15823: Support virtual-near-miss check.

2016-01-13 Thread Alexander Kornienko via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL257599: Support virtual-near-miss check. (authored by alexfh). Changed prior to commit: http://reviews.llvm.org/D15823?vs=44661&id=44746#toc Repository: rL LLVM http://reviews.llvm.org/D15823 Files

Re: [PATCH] D15823: Support virtual-near-miss check.

2016-01-13 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 with one nit. I'll update the comment myself and commit the patch for you. Thank you for the contribution! Comment at: clang-tidy/misc/VirtualNearMissCheck.cpp:60

Re: [PATCH] D15823: Support virtual-near-miss check.

2016-01-12 Thread Cong Liu via cfe-commits
congliu updated this revision to Diff 44661. congliu added a comment. - Removed braces; corrected comments; updated test. http://reviews.llvm.org/D15823 Files: clang-tidy/misc/CMakeLists.txt clang-tidy/misc/MiscTidyModule.cpp clang-tidy/misc/VirtualNearMissCheck.cpp clang-tidy/misc/Virt

Re: [PATCH] D15823: Support virtual-near-miss check.

2016-01-12 Thread Cong Liu via cfe-commits
congliu marked 9 inline comments as done. congliu added a comment. Fixed. For next steps, I will go through the results of clangmr, find out false alarms, and fix them. Comment at: clang-tidy/misc/VirtualNearMissCheck.cpp:90 @@ +89,3 @@ +// Check ambiguity. +if (Paths.i

Re: [PATCH] D15823: Support virtual-near-miss check.

2016-01-11 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. A few minor comments. Comment at: clang-tidy/misc/VirtualNearMissCheck.cpp:23 @@ +22,3 @@ +/// Finds out if the given method overrides some method. +bool isOverrideMethod(const CXXMethodDecl *MD) { + return MD->size_overridden_methods() > 0 || MD->hasAtt

Re: [PATCH] D15823: Support virtual-near-miss check.

2016-01-08 Thread Cong Liu via cfe-commits
congliu added inline comments. Comment at: clang-tidy/misc/VirtualNearMissCheck.cpp:232 @@ +231,3 @@ +const auto *BaseRD = BaseSpec.getType()->getAsCXXRecordDecl(); +if (BaseRD == nullptr) + return; alexfh wrote: > 1. When is this going to be nullptr?

Re: [PATCH] D15823: Support virtual-near-miss check.

2016-01-08 Thread Cong Liu via cfe-commits
congliu updated this revision to Diff 44328. congliu marked 33 inline comments as done. congliu added a comment. - Completed [class.virtual] p7 covarient check. Updated test. - Corrected implement of checkParamType. - Clean up. - Corrected typos. Changed some methods to free-standing. Changed warn

Re: [PATCH] D15823: Support virtual-near-miss check.

2016-01-07 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. A few more comments. Comment at: clang-tidy/misc/VirtualNearMissCheck.cpp:22 @@ +21,3 @@ + +bool VirtualNearMissCheck::isOverrideMethod(const CXXMethodDecl *MD) { + return MD->size_overridden_methods() > 0 || MD->hasAttr(); This should b

Re: [PATCH] D15823: Support virtual-near-miss check.

2016-01-07 Thread Cong Liu via cfe-commits
congliu updated this revision to Diff 44197. congliu added a comment. - Corrected naming styles; Used clang-format; Add doc to .h - Removed useless parentheses, braces around one-line ifs. - Added doc; Corrected style and typos for test. - Implemented c++ [class.virtual]p7. But has bug. - Support

Re: [PATCH] D15823: Support virtual-near-miss check.

2016-01-04 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. Looks like you've forgotten to upload a new patch. http://reviews.llvm.org/D15823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D15823: Support virtual-near-miss check.

2016-01-04 Thread Cong Liu via cfe-commits
congliu marked 20 inline comments as done. Comment at: clang-tidy/misc/VirtualNearMissCheck.cpp:59 @@ +58,3 @@ +bool VirtualNearMissCheck::isOverrideMethod(const CXXMethodDecl *MD){ + return MD->size_overridden_methods() > 0 || MD->hasAttr(); +} alexfh wrote: > W

Re: [PATCH] D15823: Support virtual-near-miss check.

2016-01-01 Thread Alexander Kornienko via cfe-commits
alexfh added inline comments. Comment at: clang-tidy/misc/VirtualNearMissCheck.cpp:85 @@ +84,3 @@ + }else { +return false; + } congliu wrote: > alexfh wrote: > > What if both return types are not references and are not pointers? Why do > > you return `false

Re: [PATCH] D15823: Support virtual-near-miss check.

2015-12-31 Thread Cong Liu via cfe-commits
congliu marked 2 inline comments as done. Comment at: clang-tidy/misc/VirtualNearMissCheck.cpp:79 @@ +78,3 @@ + if (BaseReturnType->isReferenceType() && DerivedReturnType->isReferenceType()){ +BaseReturnType = BaseReturnType.getNonReferenceType(); +DerivedReturnType = De

Re: [PATCH] D15823: Support virtual-near-miss check.

2015-12-30 Thread Alexander Kornienko via cfe-commits
alexfh added a comment. Thank you for working on this! See the initial set of comments inline. Comment at: clang-tidy/misc/VirtualNearMissCheck.cpp:21 @@ +20,3 @@ + +int VirtualNearMissCheck::editDistance(const std::string &SourceStr, +con