ccotter created this revision.
Herald added a project: All.
ccotter requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Update function bodies to forward forwarding references.
I spotted this while authoring a clang-tidy tool for CppCoreGuideline F.19
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D143877
Files:
clang/include/clang/AST/IgnoreExpr.h
Index: clang/include/clang/AST/IgnoreExpr.h
===================================================================
--- clang/include/clang/AST/IgnoreExpr.h
+++ clang/include/clang/AST/IgnoreExpr.h
@@ -23,7 +23,8 @@
inline Expr *IgnoreExprNodesImpl(Expr *E) { return E; }
template <typename FnTy, typename... FnTys>
Expr *IgnoreExprNodesImpl(Expr *E, FnTy &&Fn, FnTys &&... Fns) {
- return IgnoreExprNodesImpl(Fn(E), std::forward<FnTys>(Fns)...);
+ return IgnoreExprNodesImpl(std::forward<FnTy>(Fn)(E),
+ std::forward<FnTys>(Fns)...);
}
} // namespace detail
Index: clang/include/clang/AST/IgnoreExpr.h
===================================================================
--- clang/include/clang/AST/IgnoreExpr.h
+++ clang/include/clang/AST/IgnoreExpr.h
@@ -23,7 +23,8 @@
inline Expr *IgnoreExprNodesImpl(Expr *E) { return E; }
template <typename FnTy, typename... FnTys>
Expr *IgnoreExprNodesImpl(Expr *E, FnTy &&Fn, FnTys &&... Fns) {
- return IgnoreExprNodesImpl(Fn(E), std::forward<FnTys>(Fns)...);
+ return IgnoreExprNodesImpl(std::forward<FnTy>(Fn)(E),
+ std::forward<FnTys>(Fns)...);
}
} // namespace detail
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits