]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/27981 (Strange error message for illegal integer constant)
authorSteven G. Kargl <kargls@comcast.net>
Fri, 23 Jun 2006 21:05:04 +0000 (21:05 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Fri, 23 Jun 2006 21:05:04 +0000 (21:05 +0000)
2006-06-23  Steven G. Kargl  <kargls@comcast.net>

PR fortran/27981
* match.c (gfc_match_if):  Handle errors in assignment in simple if.

2006-06-23  Steven G. Kargl  <kargls@comcast.net>

PR fortran/27981
* gfortran.dg/simpleif_2.f90: New test.

From-SVN: r114950

gcc/fortran/ChangeLog
gcc/fortran/match.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/simpleif_2.f90 [new file with mode: 0644]

index a02bebdede7b1c2470eddab5a19ee14f211f4083..3b3584c2f085ee209e2983521c6ef371a0fc042f 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-23  Steven G. Kargl  <kargls@comcast.net>
+
+       PR fortran/27981
+       * match.c (gfc_match_if):  Handle errors in assignment in simple if.
+
 2006-06-22  Asher Langton  <langton2@llnl.gov>
 
        PR fortran/24748
index 448d927ce86524535fb3b954f9fd2bbd77bdd191..0ad5e13ce15299b70f7b740803cadc71cf20dfaa 100644 (file)
@@ -1061,6 +1061,12 @@ gfc_match_if (gfc_statement * if_type)
   gfc_undo_symbols ();
   gfc_current_locus = old_loc;
 
+  /* m can be MATCH_NO or MATCH_ERROR, here.  For MATCH_NO, continue to
+     call the various matchers.  For MATCH_ERROR, a mangled assignment
+     was found.  */
+  if (m == MATCH_ERROR)
+    return MATCH_ERROR;
+
   gfc_match (" if ( %e ) ", &expr);    /* Guaranteed to match */
 
   m = gfc_match_pointer_assignment ();
index d6deeb930fa841f2c9e64318adedbbc5e791e3af..3cb91517102152372ca93d2212ebd784dde9ca97 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-23  Steven G. Kargl  <kargls@comcast.net>
+
+       PR fortran/27981
+       * gfortran.dg/simpleif_2.f90: New test.
+
 2006-06-23  Lee Millward  <lee.millward@gmail.com>
 
        * g++.dg/template/error22.C: Fix typo.
diff --git a/gcc/testsuite/gfortran.dg/simpleif_2.f90 b/gcc/testsuite/gfortran.dg/simpleif_2.f90
new file mode 100644 (file)
index 0000000..0d8e6dd
--- /dev/null
@@ -0,0 +1,7 @@
+! { dg-do compile }
+! PR 27981
+program a
+   real x
+   real, pointer :: y
+   if (.true.) x = 12345678901 ! { dg-error "Integer too big" }
+end program a