[Bug libstdc++/26123] Segmentation fault in constructor of std::ostream::sentry::sentry

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Feb 6 12:54:00 GMT 2006



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-02-06 12:54 -------
foo.cc has nothing to do with the problem here.  It all has to do with the
order of the execution of the initializers.

The following code is enough to reproduce the issue:
int mkCint();
const int cInt = mkCint();
#include <iostream>
int main()
{
    std::cout << cInt << std::endl;
}
int mkCint()
{
    std::cout << "mkCint()" << std::endl;
    return 2;
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26123



More information about the Gcc-bugs mailing list