[Boost-bugs] [Boost C++ Libraries] #7518: boost::optional bug with boost 1.50.0 and gcc 4.4.6

Subject: [Boost-bugs] [Boost C++ Libraries] #7518: boost::optional bug with boost 1.50.0 and gcc 4.4.6
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-10-17 12:34:40


#7518: boost::optional bug with boost 1.50.0 and gcc 4.4.6
-------------------------------------------------+--------------------------
 Reporter: Boris Tschochner <monade@…> | Owner: fcacciola
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: optional
  Version: Boost 1.50.0 | Severity: Showstopper
 Keywords: optional |
-------------------------------------------------+--------------------------
 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?

 $ gcc -v

 gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)

 $ cat test.cpp

 #include <iostream>

 #include <boost/optional.hpp>

 int main()
 {
    boost::optional< int > tmp( 37 );
    std::cout << *tmp << "\n";

    return 0;
 }

 $ g++ -O3 -Wall test.cpp

 test.cpp: In function âint main()â:
 test.cpp:7: warning: âtmpâ is used uninitialized in this function

 $ ./a.out

 32767

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7518>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC