Fix handling of -> calls for modernize-use-emplace
Fixes #55869
Paths
| Differential D142939
Fix handling of -> calls for modernize-use-emplace ClosedPublic Authored by BigPeet on Jan 30 2023, 3:08 PM.
Details Summary Fix handling of -> calls for modernize-use-emplace Fixes #55869
Diff Detail
Event TimelineComment Actions This is becoming repetitive, but I guess that's the nature of those things. Maybe something like this would help clean it up, not sure if any better for right now. template <typename T> // Lambda templates would have been nice. auto onTypeOrPointerType(const T &Type) { // onUnderlyingType ? return on(anyOf(hasType(Type), hasType(pointerType(pointee(Type))))); } This revision is now accepted and ready to land.Jan 31 2023, 12:39 PM Comment Actions Refactored the code a little bit to get rid of some repetitions. Should effectively match the same code as the accepted revision.
Comment Actions LGTM
Comment Actions
I will keep this in mind. Or should this be fixed in this revision? Anyway, if this gets merged, my username/mail are GitHub username: BigPeet Thanks for the fast review response!
Closed by commit rGa543d840ee0a: Fix handling of -> calls for modernize-use-emplace (authored by BigPeet, committed by carlosgalvezp). · Explain WhyFeb 10 2023, 10:53 AM This revision was automatically updated to reflect the committed changes. Comment Actions Pushed, thanks for the contribution! I took the liberty of fixing the std::vector thing before pushing :)
Revision Contents
Diff 493745 clang-tools-extra/clang-tidy/modernize/UseEmplaceCheck.cpp
clang-tools-extra/test/clang-tidy/checkers/modernize/use-emplace.cpp
|
Generally we use prefer llvm::ArrayRef over const std::vector &