https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51266

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jvdelisle at gcc dot gnu.org

--- Comment #7 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Currently the original test case is doing this:

$ gfc z5.f90 
z5.f90:7:36:

    7 |         TYPE(T), PARAMETER :: C = T(X)  !!!
      |                                    1
Error: Parameter ‘x’ at (1) has not been declared or is a variable, which does
not reduce to a constant expression
z5.f90:12:36:

   12 |           REAL, PARAMETER :: Y = C%P  !!!
      |                                    1
Error: Unexpected ‘%’ for nonderived-type variable ‘c’ at (1)

flang allows line 7 and catches line 12.

Gemini agrees with gfortran:

"The primary issue is that the PARAMETER attribute strictly requires the
right-hand side of the initialization to be a value calculable at compile time
without any complex runtime operations like pointer association or
dereferencing. Your code attempts to define constants using pointer
manipulation, which is disallowed for PARAMETER variables."

Tobias, if you agree I think we should close this one.

Reply via email to