From: James Sedgwick Date: Thu, 8 Jan 2015 16:12:39 +0000 (-0800) Subject: fix shadowed variables X-Git-Tag: v0.22.0~20 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=0e8d462ac84bc95a37d2f2b22575746b4532a9b8 fix shadowed variables Summary: as above, fixes builds Test Plan: compiled thrift + mcrouter Reviewed By: seanc@fb.com Subscribers: seanc, fugalh, folly-diffs@ FB internal diff: D1771910 Signature: t1:1771910:1420733490:7f33e57a5853395cab786e5d35d4c15c75a15c5a --- diff --git a/folly/wangle/futures/Future-inl.h b/folly/wangle/futures/Future-inl.h index a980ff03..31cca9e5 100644 --- a/folly/wangle/futures/Future-inl.h +++ b/folly/wangle/futures/Future-inl.h @@ -370,8 +370,8 @@ Future::onError(F&& func) { f2.setCallback_([pm](Try&& t2) mutable { pm->fulfilTry(std::move(t2)); }); - } catch (const std::exception& e) { - pm->setException(exception_wrapper(std::current_exception(), e)); + } catch (const std::exception& e2) { + pm->setException(exception_wrapper(std::current_exception(), e2)); } catch (...) { pm->setException(exception_wrapper(std::current_exception())); } @@ -811,9 +811,9 @@ Future Future::within(Duration dur, E e, Timekeeper* tk) { try { t.throwIfFailed(); ctx->promise.setException(std::move(ctx->exception)); - } catch (std::exception const& e) { + } catch (std::exception const& e2) { ctx->promise.setException( - exception_wrapper(std::current_exception(), e)); + exception_wrapper(std::current_exception(), e2)); } catch (...) { ctx->promise.setException( exception_wrapper(std::current_exception())); diff --git a/folly/wangle/futures/Promise-inl.h b/folly/wangle/futures/Promise-inl.h index d7ad250c..2ded4430 100644 --- a/folly/wangle/futures/Promise-inl.h +++ b/folly/wangle/futures/Promise-inl.h @@ -84,9 +84,9 @@ Promise::setException(E const& e) { } template -void Promise::setException(std::exception_ptr const& e) { +void Promise::setException(std::exception_ptr const& ep) { try { - std::rethrow_exception(e); + std::rethrow_exception(ep); } catch (const std::exception& e) { setException(exception_wrapper(std::current_exception(), e)); } catch (...) {