Cherry-pick r161317 to fix the build with GCC 4.6

Reviewed-by: Trust me.