Opened 10 years ago

Closed 10 years ago

#7518 closed Bugs (duplicate)

boost::optional bug with boost 1.50.0 and gcc 4.4.6

Reported by: Boris Tschochner <monade@…> Owned by: Fernando Cacciola
Milestone: To Be Determined Component: optional
Version: Boost 1.50.0 Severity: Showstopper
Keywords: optional Cc: gcc 4.4.6

Description

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

Change History (1)

comment:1 by Steven Watanabe, 10 years ago

Resolution: duplicate
Status: newclosed

Duplicates #7219.

Note: See TracTickets for help on using tickets.