-
Committer:
Facebook Github Bot
-
Author(s):
Yedidya Feldblum
-
Date:
2019-05-23 22:14:24 UTC
-
Revision ID:
git-v1:33cdc59844fd5eb04effd3258494cb5dcee78bd8
Fix returning reference to temporary in futures test
Summary:
[Folly] Fix returning reference to temporary in futures test.
```
folly/futures/test/FutureTest.cpp: In instantiation of 'typename std::enable_if<(! isTry), R>::type folly::Try<NoThrowTestResult>::get() [with bool isTry = false; R = NoThrowTestResult&&; typename std::enable_if<(! isTry), R>::type = NoThrowTestResult&&]':
folly/futures/Future-inl.h:95:30: required from 'auto folly::futures::detail::wrapInvoke(folly::Try<T>&&, F&&) [with T = NoThrowTestResult; F = Future_NoThrow_Test::TestBody()::<lambda(NoThrowTestResult&&)>]'
folly/futures/Future-inl.h:1209:39: required from 'folly::Future<typename folly::futures::detail::valueCallableResult<T, F>::value_type> folly::Future<T>::thenValue(F&&) && [with F = Future_NoThrow_Test::TestBody()::<lambda(NoThrowTestResult&&)>; T = NoThrowTestResult; typename folly::futures::detail::valueCallableResult<T, F>::value_type = NoThrowTestResult]'
folly/futures/test/FutureTest.cpp:1408:14: required from here
folly/futures/test/FutureTest.cpp:1392:33: warning: returning reference to temporary [-Wreturn-local-addr]
1392 | return std::forward<R>(value());
```
Fixes #1130.
Reviewed By: LeeHowes
Differential Revision: D15457369
fbshipit-source-id: 045ae3321f957546a6218ee5e3118753e4c8ceb2