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
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
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
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
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
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?
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
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
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
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
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
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
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
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
14 matches
Mail list logo