This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31560] Array size declaration depended on order of declaration of variable containing size
- From: "tobi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Apr 2007 14:22:46 -0000
- Subject: [Bug fortran/31560] Array size declaration depended on order of declaration of variable containing size
- References: <bug-31560-14401@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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