Boost C++ Libraries: Ticket #7518: boost::optional bug with boost 1.50.0 and gcc 4.4.6 https://svn.boost.org/trac10/ticket/7518 <p> Following code fails with optimization level -03 under gcc 4.4.6: This compiler is the default gcc with Redhat 6.3. What can I do? </p> <p> $ gcc -v </p> <p> gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) </p> <p> $ cat test.cpp </p> <p> #include &lt;iostream&gt; </p> <p> #include &lt;boost/optional.hpp&gt; </p> <p> int main() { </p> <blockquote> <p> boost::optional&lt; int &gt; tmp( 37 ); std::cout &lt;&lt; *tmp &lt;&lt; "\n"; </p> </blockquote> <blockquote> <p> return 0; </p> </blockquote> <p> } </p> <p> $ g++ -O3 -Wall test.cpp </p> <p> test.cpp: In function âint main()â: test.cpp:7: warning: âtmpâ is used uninitialized in this function </p> <p> $ ./a.out </p> <p> 32767 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7518 Trac 1.4.3 Steven Watanabe Fri, 15 Feb 2013 18:59:13 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7518#comment:1 https://svn.boost.org/trac10/ticket/7518#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">duplicate</span> </li> </ul> <p> Duplicates <a class="new ticket" href="https://svn.boost.org/trac10/ticket/7219" title="#7219: Bugs: boost::optional&lt;int&gt; gives strict alias warning on GCC 4.4.6, breaks ... (new)">#7219</a>. </p> Ticket