]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/34557 (Rejects valid: EQUIVALENCE of character substrings)
authorTobias Burnus <burnus@net-b.de>
Fri, 4 Jan 2008 09:11:26 +0000 (10:11 +0100)
committerTobias Burnus <burnus@gcc.gnu.org>
Fri, 4 Jan 2008 09:11:26 +0000 (10:11 +0100)
2008-01-04  Tobias Burnus  <burnus@net-b.de>

       PR fortran/34557
       * primary.c (match_varspec): Gobble whitespace before
       checking for '('.

2008-01-04  Tobias Burnus  <burnus@net-b.de>

       PR fortran/34557
       * gfortran.dg/equiv_substr.f90: New.

From-SVN: r131317

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

index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..82f4cd7aea436134faa00d75f6ca7d0c20f178b5 100644 (file)
@@ -0,0 +1,5 @@
+2008-01-04  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/34557
+       * primary.c (match_varspec): Gobble whitespace before
+       checking for '('.
index 155cfb16dfc1c7de625d246ccf1861c53510bfbb..1d282f2b37c36482593112f097e976a178a2cdeb 100644 (file)
@@ -1679,6 +1679,7 @@ match_varspec (gfc_expr *primary, int equiv_flag)
 
   tail = NULL;
 
+  gfc_gobble_whitespace ();
   if ((equiv_flag && gfc_peek_char () == '(') || sym->attr.dimension)
     {
       /* In EQUIVALENCE, we don't know yet whether we are seeing
@@ -1692,6 +1693,7 @@ match_varspec (gfc_expr *primary, int equiv_flag)
       if (m != MATCH_YES)
        return m;
 
+      gfc_gobble_whitespace ();
       if (equiv_flag && gfc_peek_char () == '(')
        {
          tail = extend_ref (primary, tail);
index 6f91d5dcda72b28081f4b7469fa24c640557a561..dd6423694053638d147044b61e969d45e0fbe2a5 100644 (file)
@@ -1,3 +1,8 @@
+2008-01-04  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/34557
+       * gfortran.dg/equiv_substr.f90: New.
+
 2008-01-03  Tom Tromey  <tromey@redhat.com>
 
        PR c/34457:
diff --git a/gcc/testsuite/gfortran.dg/equiv_substr.f90 b/gcc/testsuite/gfortran.dg/equiv_substr.f90
new file mode 100644 (file)
index 0000000..cd186cf
--- /dev/null
@@ -0,0 +1,10 @@
+! { dg-do compile }
+!
+! PR fortran/34557
+!
+! Substrings with space before '(' were not properly parsed.
+!
+implicit none
+character :: A(2,2)*2, B(2)*3, C*5
+equivalence (A (2,1) (1:1), B (1) (2:3), C (3:5))
+end