This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/35779] error pointer wrong in PARAMETER



------- Comment #3 from dfranke at gcc dot gnu dot org  2010-05-09 20:02 -------
Experimental patch below gives:

$ gfortran-svn -Wall -W pr35779.f90 
pr35779.f90:3.44:

  integer, PARAMETER :: I2(10) = (/ (J1, J1=its_bad, 1, -1) /)
                                            1
Error: Parameter 'its_bad' at (1) has not been declared or is a variable, which
does not reduce to a constant expression


Some cleanup and regtesting is needed, though.



Index: array.c
===================================================================
--- array.c     (revision 159195)
+++ array.c     (working copy)
@@ -847,7 +847,7 @@ check_duplicate_iterator (gfc_constructo
 static match match_array_cons_element (gfc_constructor_base *);

 /* Match a list of array elements.  */
-
+extern bool init_flag;
 static match
 match_array_list (gfc_constructor_base *result)
 {
@@ -879,7 +879,7 @@ match_array_list (gfc_constructor_base *

   for (n = 1;; n++)
     {
-      m = gfc_match_iterator (&iter, 0);
+      m = gfc_match_iterator (&iter, init_flag);
       if (m == MATCH_YES)
        break;
       if (m == MATCH_ERROR)


-- 

dfranke at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dfranke at gcc dot gnu dot
                   |                            |org
         AssignedTo|unassigned at gcc dot gnu   |dfranke at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2008-03-31 19:56:29         |2010-05-09 20:02:58
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35779


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]