public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug java/12434] New: Field called java causes confusion.
@ 2003-09-28 14:52 suckfish at ihug dot co dot nz
  2003-09-28 15:16 ` [Bug java/12434] " suckfish at ihug dot co dot nz
  2003-09-30 23:00 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: suckfish at ihug dot co dot nz @ 2003-09-28 14:52 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12434

           Summary: Field called java causes confusion.
           Product: gcc
           Version: 3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: java
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: suckfish at ihug dot co dot nz
                CC: gcc-bugs at gcc dot gnu dot org

gcj implements an expression like foo.class by synthesizing a call to
java.lang.class.forName.

The compiler gets a bit confused if you have a field called java.

$ dev/test/bin/gcj -fsyntax-only broken.java
broken.java: In class `broken':
broken.java: In method `class$(java.lang.String)':
broken.java:8: error: Can't make a static reference to nonstatic variable `java'
in class `broken'.
   }
   ^
1 error


It should be possible to fix this by setting RESOLVE_PACKAGE_NAME_P on the
synthesized name, and then making sure we don't change that later.  The name
resolution code is "interesting" though.

The method name on the error message above is interesting too.

class broken {
    int java;

    Class foo()
    {
	return broken.class;
    }
}


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

* [Bug java/12434] Field called java causes confusion.
  2003-09-28 14:52 [Bug java/12434] New: Field called java causes confusion suckfish at ihug dot co dot nz
@ 2003-09-28 15:16 ` suckfish at ihug dot co dot nz
  2003-09-30 23:00 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: suckfish at ihug dot co dot nz @ 2003-09-28 15:16 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12434


suckfish at ihug dot co dot nz changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid


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

* [Bug java/12434] Field called java causes confusion.
  2003-09-28 14:52 [Bug java/12434] New: Field called java causes confusion suckfish at ihug dot co dot nz
  2003-09-28 15:16 ` [Bug java/12434] " suckfish at ihug dot co dot nz
@ 2003-09-30 23:00 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-09-30 23:00 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12434


pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-09-30 22:17:58
               date|                            |


------- Additional Comments From pinskia at gcc dot gnu dot org  2003-09-30 22:17 -------
I can confirm this on the mainline (20030925).


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

end of thread, other threads:[~2003-09-30 22:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-28 14:52 [Bug java/12434] New: Field called java causes confusion suckfish at ihug dot co dot nz
2003-09-28 15:16 ` [Bug java/12434] " suckfish at ihug dot co dot nz
2003-09-30 23:00 ` pinskia 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).