[PATCH] D60507: [clang-tidy] new check: bugprone-unhandled-self-assignment
Tamás Zolnai via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 23 10:59:09 PDT 2019
ztamas added a comment.
Ok, so I removed the alias from cert module and added CERT rule link as a "see also".
So I think we solved the problem that things do not conform with the CERT requirements and can focus on the actual problem.
Summary, templates are still ignored. If there is any idea how to solve this for templates easily or there is any sample code for this, then I happy to implement template support.
I see a related comment in clang-tidy/modernize/PassByValueCheck.cpp:
// Clang builds a CXXConstructExpr only when it knows which
// constructor will be called. In dependent contexts a
// ParenListExpr is generated instead of a CXXConstructExpr,
// filtering out templates automatically for us.
So It's not only me who sees that template AST is different.
Also, two good ideas were mentioned about extra options during the review.
1. Allow finding catches not just pointers and arrays
2. Allow configuring list of suspicious field types / pointer types
I think these two options are good ideas for future improvements. For now, the check seems useful and produces not many false positives in the current form, I think.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits