[clang] Add isTrivial() and isTriviallyCopyable() AST matchers (PR #90634)

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 11 10:15:24 PDT 2024


higher-performance wrote:

@AaronBallman that makes sense, thanks! For `isTrivial`, I do see it is used in two places, but they're not fully compatible (one operates on `QualType`, and neither works on methods):

- https://github.com/llvm/llvm-project/blob/ebe77cc320a1bcc8e2cec44f4f388fb43b72016d/clang-tools-extra/clang-tidy/bugprone/UnusedLocalNonTrivialVariableCheck.cpp#L33-L36
- https://github.com/llvm/llvm-project/blob/83ce139721260d176773d811f576289370f3313c/libcxx/test/tools/clang_tidy_checks/hide_from_abi.cpp#L16

Is that worth adding/migrating to?

Otherwise, for `isTriviallyCopyable`, I only see one matcher with that name, but it's incompatible.

https://github.com/llvm/llvm-project/pull/90634


More information about the cfe-commits mailing list