aaron.ballman added a subscriber: aaron.ballman.

================
Comment at: clang-tidy/utils/TypeTraits.cpp:20
@@ -18,1 +19,3 @@
 
+using namespace ::clang::ast_matchers;
+
----------------
I would prefer this be used locally instead of at namespace scope to avoid 
potential name collisions.

================
Comment at: clang-tidy/utils/TypeTraits.cpp:32
@@ +31,3 @@
+  auto *Record = Type->getAsCXXRecordDecl();
+  if (Record == nullptr || !Record->hasDefinition())
+    return false;
----------------
`!Record` instead of explicit comparison.

================
Comment at: clang-tidy/utils/TypeTraits.cpp:34
@@ +33,3 @@
+    return false;
+  auto Matches = match(cxxRecordDecl(hasMethod(
+                           cxxConstructorDecl(isCopyConstructor(), isDeleted())
----------------
Why use the matcher at all? You have the record decl, it can give you the copy 
constructor, and you can directly inspect whether that is deleted or not.

================
Comment at: test/clang-tidy/performance-unnecessary-value-param.cpp:27
@@ +26,3 @@
+struct MoveOnlyType {
+  MoveOnlyType(const MoveOnlyType&) = delete;
+  ~MoveOnlyType();
----------------
This is not a move-only type. Because you have a user-declared copy constructor 
(or destructor), the move constructor will not be implicitly declared. See 
[class.copy]p9 for details.


Repository:
  rL LLVM

http://reviews.llvm.org/D20170



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to