public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* java/1315: Empty inner class initializer crash
@ 2000-12-20 12:24 bryce
  0 siblings, 0 replies; only message in thread
From: bryce @ 2000-12-20 12:24 UTC (permalink / raw)
  To: java-gnats

>Number:         1315
>Category:       java
>Synopsis:       Inner class initializer crash
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    apbianco
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:18:58 PST 2000
>Closed-Date:    
>Last-Modified:  Fri Oct 20 03:31:52 PDT 2000
>Originator:     Bryce McKinlay
>Release:        gcc version 2.96 20000722 (experimental)
>Organization:
>Environment:
any
>Description:
An inner class with an empty instance initializer block that
also has an explicit constructor results in an error:

$ gcj -c Empty.java 
Empty.java: In class `Empty$Inner':
Empty.java: In method `Empty$Inner(Empty)':
Empty.java:0: Tree check: expected block, have compound_expr
Empty.java:0: Internal compiler error in fix_constructors, at ./parse.y:8384
Please submit a full bug report.
See <URL: http://www.gnu.org/software/gcc/bugs.html > for instructions.

my line 8384 reads:

	  compound = add_stmt_to_compound (compound, NULL_TREE,
					   BLOCK_EXPR_BODY (main_block));
>How-To-Repeat:
Try to compile this test case:

class Empty
{
  class Inner
  {
    {
    }
    
    Inner() {}
  }
}
>Fix:

>Release-Note:

>Audit-Trail:

Formerly PR gcj/293


From: Bryce McKinlay <bryce@albatross.co.nz>
To: java-gnats@sourceware.cygnus.com, apbianco@cygnus.com
Cc:  
Subject: Re: gcj/293
Date: Fri, 20 Oct 2000 23:23:51 +1300

 > Empty inner class initializer crash
 >
 
 Actually the initializer doesn't have to be empty. Any inner class that
 has both a default constructor and an initializer block will trigger
 this bug. eg:
 
 class InnerInit
 {
   int a = 5;
 
   class Inner
   {
     int b;
 
     {
       b = a;
     }
 
     Inner()
     {
       System.out.println (b);
     }
   }
 }
 
 regards
 
   [ bryce ]
 
 
 http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=293&database=java
 
 
 
>Unformatted:



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-12-20 12:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:24 java/1315: Empty inner class initializer crash bryce

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).