aaron.ballman added inline comments.
Comment at: clang-tidy/misc/UserDefinedCopyWithoutAssignmentCheck.cpp:22
@@ +21,3 @@
+void UserDefinedCopyWithoutAssignmentCheck::registerMatchers(
+MatchFinder *Finder) {
+ Finder->addMatcher(
Before registering the match
jbcoe added inline comments.
Comment at: clang-tidy/misc/UserDefinedCopyWithoutAssignmentCheck.cpp:52
@@ +51,3 @@
+ hasDescendant(
+ cxxMethodDecl(isMoveAssignmentOperator(), unless(isImplicit()))
+ .bind("move-assignment")),
jbcoe updated this revision to Diff 45729.
jbcoe added a comment.
Added handling for move-constructor/move-assignment pairs.
http://reviews.llvm.org/D16376
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/UserDefinedCopyWithoutAssignmentCheck.cpp
jbcoe planned changes to this revision.
jbcoe added a comment.
i need the matcher from http://reviews.llvm.org/D16470 to add a corresponding
pair of checks and fixes for move-constructors and move-assignment.
http://reviews.llvm.org/D16376
___
cfe-
jbcoe added inline comments.
Comment at: clang-tidy/misc/UserDefinedCopyWithoutAssignmentCheck.h:25
@@ +24,3 @@
+/// assignment operator to be `= delete`.
+///
+/// For the user-facing documentation see:
jbcoe wrote:
> The standard says that compiler generation of
jbcoe updated this revision to Diff 45573.
jbcoe added a comment.
Added symmetric check for user-defined assignment but no copy constructor.
Check now adds '=default' to the missing special function if the user-specified
one was specified as '=default'.
Check needs renaming, I'll update it alon
jbcoe marked 2 inline comments as done.
jbcoe added a comment.
http://reviews.llvm.org/D16376
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
jbcoe marked 5 inline comments as done.
Comment at: clang-tidy/misc/UserDefinedCopyWithoutAssignmentCheck.h:25
@@ +24,3 @@
+/// assignment operator to be `= delete`.
+///
+/// For the user-facing documentation see:
The standard says that compiler generation of the
jbcoe removed rL LLVM as the repository for this revision.
jbcoe updated this revision to Diff 45554.
jbcoe added a comment.
Made requested changes.
http://reviews.llvm.org/D16376
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/UserDefinedCopyWitho
alexfh added inline comments.
Comment at:
docs/clang-tidy/checks/misc-user-defined-copy-without-assignment.rst:6
@@ +5,3 @@
+
+MSVC 2015 will generate an assignment operator even if the user defines a copy
constructor.
+This check finds classes with a user-defined (including del
aaron.ballman added subscribers: dblaikie, rsmith.
Comment at: clang-tidy/misc/UserDefinedCopyWithoutAssignmentCheck.cpp:51
@@ +50,3 @@
+
+ Diag << FixItHint::CreateInsertion(CCtorEnd, Insertion.str());
+}
alexfh wrote:
> aaron.ballman wrote:
> > We probably do n
alexfh added inline comments.
Comment at: clang-tidy/misc/UserDefinedCopyWithoutAssignmentCheck.cpp:32
@@ +31,3 @@
+
+ if (MatchedDecl->isImplicit())
+return;
This check should be done in the matcher.
Comment at: clang-tidy/misc/UserDefinedC
aaron.ballman added inline comments.
Comment at: clang-tidy/misc/UserDefinedCopyWithoutAssignmentCheck.cpp:37
@@ +36,3 @@
+
+ DiagnosticBuilder Diag = diag(MatchedDecl->getLocation(), "class '%0'
defines a copy-constructor but not an assignment operator")
+ << ClassName;
--
13 matches
Mail list logo