Initialize variable before using in own initialization
authorMichael Connor <mconnor@fb.com>
Wed, 27 Mar 2013 17:16:59 +0000 (10:16 -0700)
committerJordan DeLong <jdelong@fb.com>
Sun, 21 Apr 2013 20:21:06 +0000 (13:21 -0700)
commit8a4545eda1686b36347fde1b7d55320684cbba8a
tree83f0e523b83c864eec3cec6501873ebe9dd73ad1
parent5e3674ca805202eee22829ee936c11a38dabd6ab
Initialize variable before using in own initialization

Summary:
Clang throws error because the callback refers to itself inside its lambda
function definition.  I prevent this by declaring the variable first then the
compiler does not complain when it is used within its lambda definition.

folly/test/TimeoutQueueTest.cpp:99:37: error: variable 'cb' is uninitialized
when used within its own initialization [-Werror,-Wuninitialized]

Test Plan:
fbconfig --clang --platform=gcc-4.7.1-glibc-2.14.1 --with-project-version
boost:1.51.0 folly/test/
fbmake opt
fbmake runtests_opt

Reviewed By: ldbrandy@fb.com

FB internal diff: D753061
folly/test/TimeoutQueueTest.cpp