Bug 4467 - Ambiguous name resolution problem
Summary: Ambiguous name resolution problem
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 3.1
: P3 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on: 28067
Blocks:
  Show dependency treegraph
 
Reported: 2001-10-03 23:46 UTC by Bryce McKinlay
Modified: 2007-01-09 20:43 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-09-23 22:56:54


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bryce McKinlay 2001-10-03 23:46:01 UTC
GCJ should reject this illegal code, because name resolution
should stop at the innermost scope which defines "X". See
JLS 6.5.2.

package X;

class Y {}

class X
{
  void a(X.Y xy) {}
}

Release:
gcc version 3.1 20011003 (experimental)
Comment 1 Dara Hazeghi 2003-05-12 11:46:43 UTC
From: Dara Hazeghi <dhazeghi@yahoo.com>
To: bryce@gcc.gnu.org, gcc-gnats@gcc.gnu.org, tromey@gcc.gnu.org
Cc:  
Subject: Re: java/4467: Ambiguous name resolution problem
Date: Mon, 12 May 2003 11:46:43 -0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- 
 trail&database=gcc&pr=4467
 
 Hello,
 
 with gcc 3.2 the problem in this PR still appears. With 3.3 branch or  
 mainline (20030511) I get:
 ./X.java:3: error: Class `X.Y' already defined in X.java:3.
      class Y {}
            ^
 ./X.java:5: error: Class `X.X' already defined in X.java:5.
      class X
            ^
 2 errors
 
 Is this the correct error? Can this PR be closed? Thanks.
 
 Dara
 
Comment 2 Steven Bosscher 2003-05-13 06:43:45 UTC
State-Changed-From-To: open->feedback
State-Changed-Why: Looks fixed -- please confirm.
Comment 3 Andrew Pinski 2003-07-05 16:46:58 UTC
On the mainline (20030705), it rejects it iff the filename is X.java, otherwise it accepts it, 
so this is still present.
Comment 4 Tom Tromey 2007-01-09 20:43:30 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.