================
@@ -80,13 +88,16 @@ void
MoveForwardingReferenceCheck::registerMatchers(MatchFinder *Finder) {
.bind("parm-var");
Finder->addMatcher(
- callExpr(callee(unresolvedLookupExpr(
- hasAnyDeclaration(namedDecl(
- hasUnderlyingDecl(hasName("::std::move")))))
- .bind("lookup")),
- argumentCountIs(1),
- hasArgument(0, ignoringParenImpCasts(declRefExpr(
- to(ForwardingReferenceParmMatcher)))))
+ callExpr(
+ callee(unresolvedLookupExpr(
+ hasAnyDeclaration(
+ namedDecl(hasUnderlyingDecl(hasName("::std::move")))))
+ .bind("lookup")),
+ argumentCountIs(1),
+ hasArgument(0, ignoringParenImpCasts(declRefExpr(
+ to(ForwardingReferenceParmMatcher),
+ // FIXME: allow capture by reference
----------------
unterumarmung wrote:
The intent probably was like you describe it. But it doesn't do what it is
intended to do: `t` in the lambda is not a forwarding reference, it is just a
reference and `std::forward` will never "move" it.
https://github.com/llvm/llvm-project/pull/191435
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits