public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/24312]  New: C++ front-end doesn't correctly handle distinction between global initializers and ctors
@ 2005-10-11 17:14 sabre at nondot dot org
  2005-10-11 17:15 ` [Bug c++/24312] " sabre at nondot dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: sabre at nondot dot org @ 2005-10-11 17:14 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-10-04  1:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-11 17:14 [Bug c++/24312] New: C++ front-end doesn't correctly handle distinction between global initializers and ctors sabre at nondot dot org
2005-10-11 17:15 ` [Bug c++/24312] " sabre at nondot dot org
2005-10-11 17:18 ` pinskia at gcc dot gnu dot org
2005-10-27 16:22 ` pinskia at gcc dot gnu dot org
2007-10-04  1:45 ` jason at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).