Bug 20977 - Invalid long to int promotion permitted in array initializer
Summary: Invalid long to int promotion permitted in array initializer
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on: 28067
Blocks:
  Show dependency treegraph
 
Reported: 2005-04-12 20:17 UTC by Bryce McKinlay
Modified: 2007-01-09 20:47 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-02-13 03:45:10


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Bryce McKinlay 2005-04-12 20:17:04 UTC
The following code is invalid as implicitly converting a long to int could
result in the value being truncated. However, GCJ accepts this code.

public class Arraybound
{
  public byte[] x(long l)
  {
    return new byte[l];
  }
}
Comment 1 Andrew Pinski 2005-04-12 20:26:25 UTC
Confirmed.
Comment 2 Nils Hammar 2005-11-13 11:32:23 UTC
This is actually in use in the class gnu.gcj.tools.gcj_dbtool.Main.java, line 382.
Comment 3 Tom Tromey 2007-01-09 20:47:29 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.