------- Comment #8 from hjl dot tools at gmail dot com 2010-05-01 03:13 -------
A run-time testcase:
[...@gnu-34 483.xalancbmk]$ cat x.cc
extern "C" void abort (void);
class Foo
{
public:
Foo (void) : xxx (1) {};
const int xxx;
};
Foo *
bar ()
{
return new Foo;
}
int
main ()
{
Foo *p = bar ();
if (p->xxx != 1)
abort ();
return 0;
}
[...@gnu-34 483.xalancbmk]$ /export/gnu/import/rrs/158918/usr/bin/g++ -O2 x.cc
[...@gnu-34 483.xalancbmk]$ ./a.out
Segmentation fault
[...@gnu-34 483.xalancbmk]$
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43951