This revision was automatically updated to reflect the committed changes.
Closed by commit rL272896: [clang-tidy] misc-move-const-arg: Detect if result
of std::move() is being… (authored by alexfh).
Changed prior to commit:
http://reviews.llvm.org/D21223?vs=60686=60974#toc
Repository:
rL
alexfh added a comment.
BTW, I'll commit the patch for you.
http://reviews.llvm.org/D21223
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
alexfh accepted this revision.
alexfh added a comment.
LG. Thanks!
http://reviews.llvm.org/D21223
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM, but you should wait for @alexfh to sign off as well since he had some
comments.
http://reviews.llvm.org/D21223
___
mboehme updated this revision to Diff 60686.
http://reviews.llvm.org/D21223
Files:
clang-tidy/misc/MoveConstantArgumentCheck.cpp
docs/clang-tidy/checks/misc-move-const-arg.rst
test/clang-tidy/misc-move-const-arg.cpp
Index: test/clang-tidy/misc-move-const-arg.cpp
aaron.ballman added inline comments.
Comment at: test/clang-tidy/misc-move-const-arg.cpp:75-76
@@ +74,4 @@
+
+class NonMoveable {
+ public:
+ NonMoveable();
> Can you expand on this?
>
> The standard says: "If the definition of a class X does not explicitly
>
mboehme added inline comments.
Comment at: test/clang-tidy/misc-move-const-arg.cpp:75-76
@@ +74,4 @@
+
+struct NonMoveable {
+ public:
+ NonMoveable();
aaron.ballman wrote:
> This type isn't non-moveable. For that, you need to explicitly delete the
> move
mboehme updated this revision to Diff 60671.
http://reviews.llvm.org/D21223
Files:
clang-tidy/misc/MoveConstantArgumentCheck.cpp
docs/clang-tidy/checks/misc-move-const-arg.rst
test/clang-tidy/misc-move-const-arg.cpp
Index: test/clang-tidy/misc-move-const-arg.cpp
aaron.ballman added inline comments.
Comment at: test/clang-tidy/misc-move-const-arg.cpp:75-76
@@ +74,4 @@
+
+struct NonMoveable {
+ public:
+ NonMoveable();
This type isn't non-moveable. For that, you need to explicitly delete the move
constructor. Perhaps a
mboehme added inline comments.
Comment at: clang-tidy/misc/MoveConstantArgumentCheck.cpp:37
@@ +36,3 @@
+ if (BeforeArgumentsRange.isValid() && AfterArgumentsRange.isValid()) {
+(*Diag) << FixItHint::CreateRemoval(BeforeArgumentsRange)
+<<
mboehme updated this revision to Diff 60507.
http://reviews.llvm.org/D21223
Files:
clang-tidy/misc/MoveConstantArgumentCheck.cpp
docs/clang-tidy/checks/misc-move-const-arg.rst
test/clang-tidy/misc-move-const-arg.cpp
Index: test/clang-tidy/misc-move-const-arg.cpp
mboehme updated this revision to Diff 60506.
http://reviews.llvm.org/D21223
Files:
clang-tidy/misc/MoveConstantArgumentCheck.cpp
docs/clang-tidy/checks/misc-move-const-arg.rst
test/clang-tidy/misc-move-const-arg.cpp
Index: test/clang-tidy/misc-move-const-arg.cpp
alexfh added a comment.
Thank you for working on this! A few more comments in addition to what Aaron
has written.
Comment at: clang-tidy/misc/MoveConstantArgumentCheck.cpp:22
@@ +21,3 @@
+
+void ReplaceCallWithArg(const CallExpr *TheCallExpr, DiagnosticBuilder *Diag,
+
aaron.ballman added a subscriber: aaron.ballman.
aaron.ballman added a reviewer: aaron.ballman.
Comment at: clang-tidy/misc/MoveConstantArgumentCheck.cpp:20
@@ -19,1 +19,3 @@
+namespace {
+
Instead of an unnamed namespace, you should use static functions per
mboehme created this revision.
mboehme added reviewers: alexfh, hokein.
mboehme added a subscriber: cfe-commits.
Conceptually, this is very close to the existing functionality of
misc-move-const-arg, which is why I'm adding it here and not creating a new
check. For example, for a type A that is
15 matches
Mail list logo