This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/60041] New: Strange behavior
- From: "qroc.work at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 03 Feb 2014 11:15:12 +0000
- Subject: [Bug c++/60041] New: Strange behavior
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60041
Bug ID: 60041
Summary: Strange behavior
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: critical
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: qroc.work at gmail dot com
Created attachment 32025
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32025&action=edit
binary file
#include <iostream>
using namespace std;
struct Foo
{
Foo( int i )
: i_( i )
{
}
int i_;
};
void test1()
{
Foo *f2;
cout<<f2->i_<<endl;
}
int main()
{
Foo f( 123 );
test1();
Foo *f3;
cout<<f3->i_<<endl;
return 0;
}
$ g++ t.cc && ./a.out
123
-125990072
OS X 10.9
g++ (GCC) 4.9.0 20131020 (experimental)