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

Alex Strelnikov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 31 11:18:06 PDT 2018


astrelni marked 3 inline comments as done.
astrelni added inline comments.


================
Comment at: clang-tidy/abseil/UpgradeDurationConversionsCheck.cpp:158
+               *Result.Context)
+             .empty()) {
+      diag(ArgExpr->getBeginLoc(), Message);
----------------
JonasToth wrote:
> 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.
Got it work out in registerMatchers and without needing equalsBoundNode, thanks for prodding me in that direction. I tried it initially when writing the check and can't remember why I didn't get it to work last time.


https://reviews.llvm.org/D53830





More information about the cfe-commits mailing list