This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/66545] ICE on using undefined parameter/variable values
- From: "gerhard dot steinmetz dot fortran at t-online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 15 Jun 2015 19:03:17 +0000
- Subject: [Bug fortran/66545] ICE on using undefined parameter/variable values
- Auto-submitted: auto-generated
- References: <bug-66545-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66545
--- Comment #2 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
FYI, it's astonishing, but this code compiles without an ICE
and prints some reasonable error messages :
$ cat z2_type.f90
program p
type t
integer :: n
end type
type(t), parameter :: c1 = (t(c1%n))
type(t), parameter :: c2 = t(c2%n)
type(t) :: c3 = (t(c3%n))
type(t) :: c4 = t(c4%n)
type(t) :: c5
type(t) :: c6
c5 = (t(c5%n))
c6 = t(c6%n)
end
$ gfortran -c z2_type.f90
z2_type.f90:5:33:
type(t), parameter :: c1 = (t(c1%n))
1
Error: PARAMETER âc1â is used at (1) before its definition is complete
z2_type.f90:6:32:
type(t), parameter :: c2 = t(c2%n)
1
Error: PARAMETER âc2â is used at (1) before its definition is complete
z2_type.f90:7:22:
type(t) :: c3 = (t(c3%n))
1
Error: Parameter âc3â at (1) has not been declared or is a variable, which does
not reduce to a constant expression
z2_type.f90:8:21:
type(t) :: c4 = t(c4%n)
1
Error: Parameter âc4â at (1) has not been declared or is a variable, which does
not reduce to a constant Expression
#
# c5, c6 differs
#