[Bug fortran/124598] (PDT) - ICE instantiating nested PDTs
antoine.lemoine@bordeaux-inp.fr
gcc-bugzilla@gcc.gnu.org
Tue Mar 24 15:37:13 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124598
--- Comment #4 from Antoine Lemoine <antoine.lemoine@bordeaux-inp.fr> ---
(In reply to Steve Kargl from comment #2)
> (In reply to anlauf from comment #1)
>
> [...]
>
> 'n' is a type-param-name in 'type(t_baz(n)) :: baz'. OP's code is likely
> invalid because 'n' does not appear in an specification expression.
>
> However, if one changes the code to
>
> type(t_baz) :: baz ! <- REMOVE THIS LINE AND THIS PROGRAM COMPILES
>
> or
>
> type(t_baz(n=10)) :: baz ! <- REMOVE THIS LINE AND THIS PROGRAM COMPILES
>
This mistake occurred when I created the minimal example. In the actual code
where the ICE happened, n was assigned a value such as type(t_baz(3)). So, what
I intended to do is valid.
More information about the Gcc-bugs
mailing list