Fixes the checker for abseil to make tests pass in C++17 mode
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
- Build Status
Buildable 33175 Build 33174: arc lint + arc unit
Event Timeline
Comment Actions
Thanks for investigating these, nice work!
Some initial comments:
- since your patch fixes four different check, I'd suggest to separate it (one patch per check)
- there are some non-functional changes (code format), I'd avoid them in this patch (we could address them in a separate patch)
- it would be nice if you could briefly describe the AST difference between C++11 and C++17 (how the fix work) in the patch description or comments
clang-tools-extra/test/clang-tidy/abseil-duration-unnecessary-conversion.cpp | ||
---|---|---|
1 | I believe the tests are also passed for C++2a? use C++11-or-later will do the trick. |
clang-tools-extra/clang-tidy/abseil/FasterStrsplitDelimiterCheck.cpp | ||
---|---|---|
86 | hasDescendant will find any child, no matter how deeply nested. I think in this case we only want the expression itself to be equal to ByAnyChar call. Shouldn't this code use the elidable matcher you're adding in another file? | |
121 | Unrelated edit? | |
clang-tools-extra/clang-tidy/abseil/TimeSubtractionCheck.cpp | ||
34 | Ditto, hasAncestor can go too far up the tree. |
hasDescendant will find any child, no matter how deeply nested. I think in this case we only want the expression itself to be equal to ByAnyChar call. Shouldn't this code use the elidable matcher you're adding in another file?