[PATCH] D21303: [clang-tidy] Adds performance-returning-type check.
Piotr Padlewski via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 21 11:30:16 PDT 2016
Prazek added inline comments.
================
Comment at: clang-tidy/performance/ReturnValueCopyCheck.cpp:53
@@ +52,3 @@
+/// matches the given matcher.
+AST_MATCHER_P(QualType, ignoringRefsAndConsts,
+ ast_matchers::internal::Matcher<QualType>, InnerMatcher) {
----------------
This one is usefull AF. Can you put into Traversal AST Matchers?
{meme, src=brilliant}
================
Comment at: clang-tidy/performance/ReturnValueCopyCheck.cpp:114
@@ +113,3 @@
+AST_MATCHER_FUNCTION_P(ast_matchers::internal::Matcher<QualType>,
+ hasConstructorFromType,
+ ast_matchers::internal::Matcher<QualType>,
----------------
maybe isConstructibleFromType? hasConstructorFromType seems like it would take cxxConstructorDecl or something.
BTW what about conversion operator? I don't see any test using it. If implementing this would be too much work, then just write FIXME for now. I guess this case would be very uncommon.
================
Comment at: clang-tidy/performance/ReturnValueCopyCheck.cpp:142
@@ +141,3 @@
+ // Matches to expression expression that have declaration with is reference or
+ // const
+ auto IsDeclaredAsRefOrConstType =
----------------
dot at the end
http://reviews.llvm.org/D21303
More information about the cfe-commits
mailing list