This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
java/5179: Qualifed static field access doesn't initialize its class
- From: bryce at waitaki dot otago dot ac dot nz
- To: gcc-gnats at gcc dot gnu dot org
- Date: 23 Dec 2001 00:05:06 -0000
- Subject: java/5179: Qualifed static field access doesn't initialize its class
- Reply-to: bryce at waitaki dot otago dot ac dot nz
>Number: 5179
>Category: java
>Synopsis: Qualifed static field access doesn't initialize its class
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Dec 22 16:06:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Bryce McKinlay
>Release: gcc version 3.1 20011221 (experimental)
>Organization:
>Environment:
>Description:
The following test case crashes because no class initialization for "Bar" is generated.
>How-To-Repeat:
class Bar
{
static Bar B = new Bar();
int i = 1;
}
public class Qual2
{
public static void main(String[] args)
{
System.out.println (Bar.B.i); // crash
System.out.println ((Bar.B).i); // crash
}
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: