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/31560] Array size declaration depended on order of declaration of variable containing size



------- Comment #2 from tobi at gcc dot gnu dot org  2007-04-13 15:22 -------
(In reply to comment #0)
> GNU Fortran (GCC) 4.3.0 20070412 (experimental)
> Linux 2.4.20-20030701 #2 SMP 
> 
>   use ped_class
>   type (ped_data) :: dataset
>   integer, dimension(dataset%maxsiz) :: nobs
> 
> works but
> 
>   use ped_class
>   integer, dimension(dataset%maxsiz) :: nobs 
>   type (ped_data) :: dataset
> 
> doesn't.

If I understand you correctly, what you're trying to do is invalid.  You may
only reference previously declared objects in data object declarations.  In
your second example dataset is referenced before it is declared.

Please provide a complete testcase, and if the problem is indeed the order of
declarations please tell us where you think I'm wrong.


-- 

tobi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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