Commit ec9be15b authored by Abseil Team's avatar Abseil Team Committed by vslashg
Browse files

Googletest export

Workaround static assert in early versions libc++

The error is "Attempted to construct a reference element in a tuple with an
rvalue". We can fix this by putting everything into a non temporary tuple_args
and implitly convert to the other tuple types. This avoids binding an rvalue
reference to an lvalue reference inside the tuple.

PiperOrigin-RevId: 327624990
parent 655bff5d
......@@ -1050,10 +1050,11 @@ struct DoAllAction {
std::vector<Action<void(NonFinalType<Args>...)>> converted;
Action<R(Args...)> last;
R operator()(Args... args) const {
auto tuple_args = std::forward_as_tuple(std::forward<Args>(args)...);
for (auto& a : converted) {
a.Perform(std::forward_as_tuple(std::forward<Args>(args)...));
a.Perform(tuple_args);
}
return last.Perform(std::forward_as_tuple(std::forward<Args>(args)...));
return last.Perform(std::move(tuple_args));
}
};
return Op{Convert<Action<void(NonFinalType<Args>...)>>(
......
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