[PATCH] D143873: [NFC] [llvm] Forward forwarding reference pack
Chris Cotter via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Feb 12 21:32:01 PST 2023
ccotter updated this revision to Diff 496838.
ccotter added a comment.
- Add more
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143873/new/
https://reviews.llvm.org/D143873
Files:
llvm/include/llvm/ADT/BitVector.h
llvm/include/llvm/Support/Error.h
llvm/include/llvm/Support/HashBuilder.h
Index: llvm/include/llvm/Support/HashBuilder.h
===================================================================
--- llvm/include/llvm/Support/HashBuilder.h
+++ llvm/include/llvm/Support/HashBuilder.h
@@ -100,7 +100,7 @@
: HashBuilderBase<HasherT>(Hasher) {}
template <typename... ArgTypes>
explicit HashBuilderImpl(ArgTypes &&...Args)
- : HashBuilderBase<HasherT>(Args...) {}
+ : HashBuilderBase<HasherT>(std::forward<ArgTypes>(Args)...) {}
/// Implement hashing for hashable data types, e.g. integral or enum values.
template <typename T>
Index: llvm/include/llvm/Support/Error.h
===================================================================
--- llvm/include/llvm/Support/Error.h
+++ llvm/include/llvm/Support/Error.h
@@ -835,7 +835,7 @@
template <typename HandlerT>
static Error apply(HandlerT &&H, std::unique_ptr<ErrorInfoBase> E) {
assert(appliesTo(*E) && "Applying incorrect handler");
- return H(static_cast<ErrT &>(*E));
+ return std::forward<HandlerT>(H)(static_cast<ErrT &>(*E));
}
};
@@ -849,7 +849,7 @@
template <typename HandlerT>
static Error apply(HandlerT &&H, std::unique_ptr<ErrorInfoBase> E) {
assert(appliesTo(*E) && "Applying incorrect handler");
- H(static_cast<ErrT &>(*E));
+ std::forward<HandlerT>(H)(static_cast<ErrT &>(*E));
return Error::success();
}
};
@@ -866,7 +866,7 @@
static Error apply(HandlerT &&H, std::unique_ptr<ErrorInfoBase> E) {
assert(appliesTo(*E) && "Applying incorrect handler");
std::unique_ptr<ErrT> SubE(static_cast<ErrT *>(E.release()));
- return H(std::move(SubE));
+ return std::forward<HandlerT>(H)(std::move(SubE));
}
};
@@ -882,7 +882,7 @@
static Error apply(HandlerT &&H, std::unique_ptr<ErrorInfoBase> E) {
assert(appliesTo(*E) && "Applying incorrect handler");
std::unique_ptr<ErrT> SubE(static_cast<ErrT *>(E.release()));
- H(std::move(SubE));
+ std::forward<HandlerT>(H)(std::move(SubE));
return Error::success();
}
};
Index: llvm/include/llvm/ADT/BitVector.h
===================================================================
--- llvm/include/llvm/ADT/BitVector.h
+++ llvm/include/llvm/ADT/BitVector.h
@@ -550,7 +550,7 @@
"consistent sizes");
Out.resize(Arg.size());
for (size_type I = 0, E = Arg.Bits.size(); I != E; ++I)
- Out.Bits[I] = f(Arg.Bits[I], Args.Bits[I]...);
+ Out.Bits[I] = std::forward<F>(f)(Arg.Bits[I], Args.Bits[I]...);
Out.clear_unused_bits();
return Out;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143873.496838.patch
Type: text/x-patch
Size: 2526 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230213/8c093f76/attachment.bin>
More information about the llvm-commits
mailing list