[PATCH] D143877: [NFC] [clang] Forward forwarding reference

Chris Cotter via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Feb 12 21:30:23 PST 2023


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
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143877.496837.patch
Type: text/x-patch
Size: 592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230213/8936894f/attachment.bin>


More information about the cfe-commits mailing list