This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix boz error reporting (regression from 4.0.x)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Fri, 14 Oct 2005 12:09:19 -0400
- Subject: [PATCH] Fix boz error reporting (regression from 4.0.x)
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
Internationalization of match_boz_constant introduced a regression,
where we sometimes issue after the desired error message also some
non-sense ones and then die with internal error.
Ok for HEAD?
2005-10-14 Jakub Jelinek <jakub@redhat.com>
* primary.c (match_boz_constant): Add missing break after gfc_error.
* gfortran.dg/boz_5.f90: New test.
--- gcc/fortran/primary.c.jj 2005-10-12 08:13:27.000000000 +0200
+++ gcc/fortran/primary.c 2005-10-14 18:01:55.000000000 +0200
@@ -351,10 +351,13 @@ match_boz_constant (gfc_expr ** result)
{
case 2:
gfc_error ("Empty set of digits in binary constant at %C");
+ break;
case 8:
gfc_error ("Empty set of digits in octal constant at %C");
+ break;
case 16:
gfc_error ("Empty set of digits in hexadecimal constant at %C");
+ break;
default:
gcc_unreachable ();
}
@@ -367,10 +370,13 @@ match_boz_constant (gfc_expr ** result)
{
case 2:
gfc_error ("Illegal character in binary constant at %C");
+ break;
case 8:
gfc_error ("Illegal character in octal constant at %C");
+ break;
case 16:
gfc_error ("Illegal character in hexadecimal constant at %C");
+ break;
default:
gcc_unreachable ();
}
--- gcc/testsuite/gfortran.dg/boz_5.f90.jj 2005-10-14 18:05:00.000000000 +0200
+++ gcc/testsuite/gfortran.dg/boz_5.f90 2005-10-14 18:04:36.000000000 +0200
@@ -0,0 +1,4 @@
+! { dg-do compile }
+ integer, dimension (2) :: i
+ i = (/Z'abcde', Z'abcde/) ! { dg-error "Illegal character" }
+end
Jakub