[PATCH] D53830: [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 31 09:18:43 PDT 2018


JonasToth added inline comments.


================
Comment at: clang-tidy/abseil/UpgradeDurationConversionsCheck.cpp:158
+               *Result.Context)
+             .empty()) {
+      diag(ArgExpr->getBeginLoc(), Message);
----------------
astrelni wrote:
> JonasToth wrote:
> > You could ellide these braces, but I feel that this matching code be merged into one matcher with `equalsBoundNode()` (see ASTMatcher reference).
> Started with removing braces.
> 
> Sorry I had a look at `equalsBoundNode()`, but couldn't see exactly what you meant. Could you please elaborate about the merging?
i do not use that matcher on a daily basis, so take it with a grain of salt, please :)

prototype:
```
match(unless(allOf(isInTemplateInstantiation(equalsBoundNode("arg"))),
                                 expr(isInstantiationOfDependentExpr(equalsBoundNode("call")))))
```
You could do that matching in the `registerMatchers` even. The `equalsBoundNode` is suitable to connect different parts of a complexer matcher.
If you want, you can explore it. Slight simplification would be desirable here, but if it's not feasable the current form works too.


https://reviews.llvm.org/D53830





More information about the cfe-commits mailing list