[Bug c++/24312] New: C++ front-end doesn't correctly handle distinction between global initializers and ctors
sabre at nondot dot org
gcc-bugzilla@gcc.gnu.org
Tue Oct 11 17:14:00 GMT 2005
The following testcase is miscompiled:
#include <stdio.h>
double foo() { return 1.0; }
static struct S { S(); } s;
static const double Y = foo()+2.0;
S::S() {
printf("%f\n", Y);
}
int main() {
printf("%f\n", Y);
}
Both printfs should print 3 based on Mark's insight in Comment #22 of bug
21089.
-Chris
--
Summary: C++ front-end doesn't correctly handle distinction
between global initializers and ctors
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: sabre at nondot dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24312
More information about the Gcc-bugs
mailing list