This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug java/21540] switch stmt problem
- From: "tromey at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 21 Jun 2005 18:36:11 -0000
- Subject: [Bug java/21540] switch stmt problem
- References: <20050512200245.21540.green@redhat.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From tromey at gcc dot gnu dot org 2005-06-21 18:36 -------
The bug here is that the semantic analysis for a case expression,
in parse.y:java_complete_lhs(), just does this:
/* First, the case expression must be constant. Values of final
fields are accepted. */
cn = fold (cn);
However, fold() does not know about final fields and the like.
fold_constant_for_init doesn't seem to be factored properly to be
useful here, either.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21540