Bug 24835 - gcj accepts invalid code with static final variables
Summary: gcj accepts invalid code with static final variables
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 4.1.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
: 27104 (view as bug list)
Depends on: 28067
Blocks:
  Show dependency treegraph
 
Reported: 2005-11-13 16:16 UTC by Andrew Pinski
Modified: 2007-01-09 20:48 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-02-13 04:04:17


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2005-11-13 16:16:11 UTC
The following code is invalid:
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
class a
{
  private static final MessageDigest md5Digest;
    static
  {
    try
      {
        md5Digest = MessageDigest.getInstance("MD5");
      }
    catch (NoSuchAlgorithmException  _)
      {
        md5Digest = null;
      }
  }

}
-------
But is accepted.
Comment 1 Andrew Pinski 2005-11-14 13:19:28 UTC
Confirmed, since this was a split off.
Comment 2 Andrew Pinski 2006-04-10 19:04:53 UTC
*** Bug 27104 has been marked as a duplicate of this bug. ***
Comment 3 Tom Tromey 2007-01-09 20:48:10 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.