Fix maybe-uninitialized warning in Conv.h
authorMichael Lee <mzlee@fb.com>
Tue, 25 Oct 2016 16:45:49 +0000 (09:45 -0700)
committerFacebook Github Bot <facebook-github-bot-bot@fb.com>
Tue, 25 Oct 2016 16:53:47 +0000 (09:53 -0700)
Summary: Some compilers think result may be uninitialized

Reviewed By: francis-ma

Differential Revision: D4074526

fbshipit-source-id: 5df4568cfa5eb8f3b2993a82b831fd5e4028a281

folly/Conv.h

index 890b2592869ae1182dca8c69865409c1755925e8..90d7d84f4d69529631f84fd9d83480b005692b44 100644 (file)
@@ -1490,7 +1490,7 @@ Expected<Tgt, detail::ParseToError<Tgt>> tryTo(StringPiece* src) {
 
 template <class Tgt>
 Tgt to(StringPiece* src) {
-  Tgt result;
+  Tgt result{};
   using Error = detail::ParseToError<Tgt>;
   return parseTo(*src, result)
       .thenOrThrow(