Commit 5aa4053c authored by George Burgess IV's avatar George Burgess IV Committed by Commit Bot

fix an instance of bugprone-move-forwarding-reference

Unless it's guaranteed that `std::forward` always turns into an rvalue
ref, using `std::move(x)`, where `x`'s type is a universal reference, is
generally unsafe. `std::forward` is preferred for these cases.

Bug: 1134310
Change-Id: I7be8fffa71418cd9585b2eb562ffe7968aa6c753
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2444129
Commit-Queue: Ken Rockot <rockot@google.com>
Auto-Submit: George Burgess <gbiv@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Cr-Commit-Position: refs/heads/master@{#813198}
parent 076f9568
......@@ -261,7 +261,7 @@ Context* GetContext();
template <typename T>
Context::Storage::Storage(T&& value) {
wrapper_ = std::make_unique<StorageWrapper<T>>(std::move(value));
wrapper_ = std::make_unique<StorageWrapper<T>>(std::forward<T>(value));
}
template <typename T>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment