This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24312] New: C++ front-end doesn't correctly handle distinction between global initializers and ctors
- From: "sabre at nondot dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Oct 2005 17:14:06 -0000
- Subject: [Bug c++/24312] New: C++ front-end doesn't correctly handle distinction between global initializers and ctors
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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