https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59970
Mike Crowe <mac at mcrowe dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mac at mcrowe dot com
--- Comment #3 from Mike Crowe <mac at mcrowe dot com> ---
Created attachment 35384
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35384&action=edit
Preprocessed source for boost::lexical_cast case
I can reproduce the same problem with Debian Jessie's gcc 4.9.2 and a
self-compiled gcc 4.9.1 when compiling:
#include <boost/lexical_cast.hpp>
int wibble()
{
return boost::lexical_cast<int>("1");
}
Preprocessed source attached (compressed to avoid file size limit.)
$ g++ -Wall -Werror -Og -save-temps test.cpp
test.cpp: In function ‘int wibble()’:
test.cpp:5:40: error: ‘result’ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
return boost::lexical_cast<int>("1");
^
cc1plus: all warnings being treated as errors
Oddly the warning is not reported when the function is named "main"!