This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/26123] Segmentation fault in constructor of std::ostream::sentry::sentry
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 Feb 2006 12:54:27 -0000
- Subject: [Bug libstdc++/26123] Segmentation fault in constructor of std::ostream::sentry::sentry
- References: <bug-26123-12142@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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