This revision was automatically updated to reflect the committed changes.
Closed by commit rL280077: [clang-tidy] Add check
'misc-move-forwarding-reference' (authored by mboehme).
Changed prior to commit:
https://reviews.llvm.org/D0?vs=69665&id=69666#toc
Repository:
rL LLVM
https://revi
mboehme updated this revision to Diff 69665.
mboehme added a comment.
Update to current head
https://reviews.llvm.org/D0
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/MoveForwardingReferenceCheck.cpp
clang-tidy/misc/MoveForwardingReferenceC
mboehme marked an inline comment as done.
mboehme added a comment.
https://reviews.llvm.org/D0
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mboehme updated this revision to Diff 69662.
mboehme added a comment.
Fix typo
https://reviews.llvm.org/D0
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/MoveForwardingReferenceCheck.cpp
clang-tidy/misc/MoveForwardingReferenceCheck.h
docs/
aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
One minor typo fix, but otherwise LGTM. Thank you for the check!
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:125-126
@@ +124,4 @@
+
mboehme marked an inline comment as done.
mboehme added a comment.
Any more comments here?
https://reviews.llvm.org/D0
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mboehme marked 2 inline comments as done.
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:46-56
@@ +45,13 @@
+// std::move(). This will hopefully prevent erroneous replacements if the
+// code does unusual things (e.g. create an alias for std::move() in
+/
mboehme updated this revision to Diff 68322.
mboehme added a comment.
Reponses to reviewer comments
https://reviews.llvm.org/D0
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/MoveForwardingReferenceCheck.cpp
clang-tidy/misc/MoveForwardingRef
aaron.ballman added inline comments.
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:46-56
@@ +45,13 @@
+// std::move(). This will hopefully prevent erroneous replacements if the
+// code does unusual things (e.g. create an alias for std::move() in
+// ano
mboehme updated this revision to Diff 67829.
mboehme marked 2 inline comments as done.
mboehme added a comment.
Fix typo in comment
https://reviews.llvm.org/D0
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/MoveForwardingReferenceCheck.cpp
c
mboehme added inline comments.
Comment at: test/clang-tidy/misc-move-forwarding-reference.cpp:50
@@ +49,3 @@
+// operator.
+template void f5(U &&SomeU) {
+ {
Sorry, that should have been "scope resolution operator". Comment changed.
What this is trying to test
mboehme updated this revision to Diff 67830.
mboehme added a comment.
Restore spaces around scope resolution operator in test case
https://reviews.llvm.org/D0
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/MoveForwardingReferenceCheck.cpp
cl
mboehme updated this revision to Diff 67828.
mboehme added a comment.
Handle case where the forwarding reference is a parameter of a generic lambda.
https://reviews.llvm.org/D0
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/MoveForwardingRefer
aaron.ballman added inline comments.
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:64
@@ +63,3 @@
+void MoveForwardingReferenceCheck::registerMatchers(MatchFinder *Finder) {
+ if (!getLangOpts().CPlusPlus11)
+return;
sbenza wrote:
> I'm guessin
sbenza added inline comments.
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:64
@@ +63,3 @@
+void MoveForwardingReferenceCheck::registerMatchers(MatchFinder *Finder) {
+ if (!getLangOpts().CPlusPlus11)
+return;
I'm guessing this is checking Lang
mboehme added a comment.
Now that https://reviews.llvm.org/D23004 is submitted, can you take another
look?
https://reviews.llvm.org/D0
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co
mboehme updated this revision to Diff 66914.
mboehme marked 2 inline comments as done.
mboehme added a comment.
Renamed canReferToDecl to hasAnyDeclaration.
This is for consistency with the corresponding change in
https://reviews.llvm.org/D23004.
https://reviews.llvm.org/D0
Files:
mboehme marked 7 inline comments as done.
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:93
@@ +92,3 @@
+ hasArgument(0, ignoringParenImpCasts(declRefExpr(
+ to(ForwardingReferenceParmMatcher)
+ .bind("call-
mboehme updated this revision to Diff 66284.
mboehme marked 3 inline comments as done.
https://reviews.llvm.org/D0
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/MoveForwardingReferenceCheck.cpp
clang-tidy/misc/MoveForwardingReferenceCheck.h
sbenza added inline comments.
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:93
@@ +92,3 @@
+ hasArgument(0, ignoringParenImpCasts(declRefExpr(
+ to(ForwardingReferenceParmMatcher)
+ .bind("call-move"),
aaron.ballman added a subscriber: klimek.
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:44-54
@@ +43,13 @@
+if (OriginalText == "::std::move") {
+ Diag << FixItHint::CreateReplacement(CallRange, "::std::" + ForwardName);
+ // If the original text was s
mboehme marked 13 inline comments as done.
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:20
@@ +19,3 @@
+
+static void ReplaceMoveWithForward(const UnresolvedLookupExpr *Callee,
+ const TemplateTypeParmType *TypeParmType,
--
mboehme updated this revision to Diff 65484.
mboehme marked an inline comment as done.
mboehme added a comment.
Changes in response to reviewer comments
https://reviews.llvm.org/D0
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/MoveForwardingR
sbenza added inline comments.
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:20
@@ +19,3 @@
+
+static void ReplaceMoveWithForward(const UnresolvedLookupExpr *Callee,
+ const TemplateTypeParmType *TypeParmType,
aaron.
etienneb added a subscriber: etienneb.
etienneb added a comment.
thx for the check
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:25
@@ +24,3 @@
+ const SourceManager &SM = Context->getSourceManager();
+ const LangOptions LangOpts = Context->getLangOpts();
+
alexfh added a subscriber: alexfh.
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:36
@@ +35,3 @@
+(llvm::Twine("forward<") + TypeParmType->getDecl()->getName() +
+ llvm::Twine(">"))
+.str();
nit: The second `llvm::Twine` i
aaron.ballman added a subscriber: aaron.ballman.
aaron.ballman added a reviewer: aaron.ballman.
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:20
@@ +19,3 @@
+
+static void ReplaceMoveWithForward(const UnresolvedLookupExpr *Callee,
+
Prazek added inline comments.
Comment at: docs/clang-tidy/checks/misc-move-forwarding-reference.rst:30
@@ +29,3 @@
+Background
+--
+
Nothing from me. It's just general comment
https://reviews.llvm.org/D0
___
mboehme marked 5 inline comments as done.
mboehme added a comment.
In http://reviews.llvm.org/D0#480415, @mgehre wrote:
> Nice check. This should be mentioned in docs/ReleaseNotes.rst
Done.
Comment at: clang-tidy/misc/MoveForwardingReferenceCheck.cpp:34
@@ +33,3 @@
+ if
mboehme updated this revision to Diff 63663.
mboehme added a comment.
Addressed Prazek's review comments.
http://reviews.llvm.org/D0
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/MoveForwardingReferenceCheck.cpp
clang-tidy/misc/MoveForwardi
Prazek added a subscriber: Prazek.
Prazek added a comment.
Very usefull check!
I don't have enough time right now to check everything, so better wait for
review of Alexfh or someone else. I just wanted to leave some thoughts.
Comment at: clang-tidy/misc/MoveForwardingReferenceC
Eugene.Zelenko added a subscriber: Eugene.Zelenko.
Eugene.Zelenko added a comment.
Please mention this check in docs/ReleaseNotes.rst (in alphabetical order).
http://reviews.llvm.org/D0
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
htt
mgehre added a subscriber: mgehre.
mgehre added a comment.
Nice check. This should be mentioned in docs/ReleaseNotes.rst
http://reviews.llvm.org/D0
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/lis
mboehme created this revision.
mboehme added a reviewer: sbenza.
mboehme added a subscriber: cfe-commits.
The check emits a warning if std::move() is applied to a forwarding reference,
i.e. an rvalue reference of a function template argument type.
If a developer is unaware of the special rules f
34 matches
Mail list logo