Bug 1330 - Forward initializer references not checked
Summary: Forward initializer references not checked
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 3.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Alexandre Petit-Bianco
URL:
Keywords: accepts-invalid
Depends on: 28067
Blocks:
  Show dependency treegraph
 
Reported: 2000-12-20 12:19 UTC by Bryce McKinlay
Modified: 2007-01-09 20:43 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-09-07 16:50:14


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bryce McKinlay 2000-12-20 12:19:05 UTC
The following code is illegal because initializers are 
are supposed to run in declared order and arn't allowed to 
forward reference each other. gcj does not detect this 
error.

class InitOrder
{
  static int foo = bar;
  static int bar = 5;
}

Release:
unknown

Environment:
any

How-To-Repeat:
Compile the test case.
Comment 1 Dara Hazeghi 2003-05-11 20:07:43 UTC
From: Dara Hazeghi <dhazeghi@yahoo.com>
To: apbianco@gcc.gnu.org, gcc-gnats@gcc.gnu.org, bryce@albatross.co.nz
Cc:  
Subject: Re: java/1330: Forward initializer references not checked
Date: Sun, 11 May 2003 20:07:43 -0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- 
 trail&database=gcc&pr=1330
 
 Hello,
 
 this bug was reported against (I presume) pre gcc 3.0 sources. Would it  
 be possible to determine if this problem is still present in current  
 sources? Thanks,
 
 Dara
Comment 2 Andrew Pinski 2003-05-24 23:32:29 UTC
It still is a problem in the mainline (20030524).
Comment 3 Tom Tromey 2007-01-09 20:43:18 UTC
All gcj front end bugs have been fixed by the gcj-eclipse branch merge.
I'm mass-closing the affected PRs.
If you believe one of these was closed in error, please reopen it
with a note explaining why.
Thanks.