markeggleston at gcc dot changed:

           What    |Removed                     |Added
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2020-02-12
                 CC|                            |markeggleston at gcc dot
     Ever confirmed|0                           |1

--- Comment #1 from markeggleston at gcc dot ---
Introduced with
"decl.c (match_data_constant): Fortran 2018 allows pointer initialization in a
data statement."

Changing the example code to:

program p
   type t
      integer :: a
   end type
   type(t) :: x
   integer, target :: c = 10
   data x%a /c/
end program

results in:

    7 |    data x%a /c/
      |              1
Error: non-constant initialization expression at (1)

I think the error message is inadequate, it ought to state that 'a' does not
have the pointer attribute or something along those lines.

The ICE only appears to occur if the types of a and x are both CHARACTER.

This is a feature of Fortran 2018, however with the pointer attribute added to
a the code compiles irrespective of the -std option.

I think the issues of error messages and -std can be postponed until the next

Reply via email to