------- Comment #7 from rguenth at gcc dot gnu dot org 2006-02-06 15:07 ------- I think this is undefined. Reduced testcase:
extern "C" void *malloc(__SIZE_TYPE__ n); int mkCint(); const int cInt = mkCint(); struct Ptr { Ptr() { ptr = (int *)malloc(sizeof(int)); } int *ptr; }; Ptr p; int main() { *p.ptr = mkCint(); } int mkCint() { return *p.ptr; } how should we know to initialize std::cout first? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26123