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

markeggleston at gcc dot gnu.org changed:

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

--- Comment #1 from markeggleston at gcc dot gnu.org ---
Introduced with https://gcc.gnu.org/g:b6e841a699fe43ddf632dd79e0002dd51c8bf864
"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
release.

Reply via email to