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

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |error-recovery,
                   |                            |ice-on-invalid-code
            Summary|[7/8/9 Regression] compiler |[7/8 Regression] compiler
                   |error when using modules    |error when using modules
                   |with derived types in block |with derived types in block
                   |data subprograms            |data subprograms

--- Comment #4 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
This has been fixed in the meantime, at least there is a
(double) error now:

$ gfortran orig.f90 
orig.f90:43:6:

   43 |   use mod1
      |      1
Error: PRIVATE attribute not allowed in BLOCK DATA program unit at (1)
orig.f90:43:6:

   43 |   use mod1
      |      1
Error: PRIVATE attribute not allowed in BLOCK DATA program unit at (1)

The error is correct, according to F2018:

C1415
 (R1420) A block-data specification-part shall contain only derived-type
definitions and ASYNCHRONOUS, BIND, COM-
MON, DATA, DIMENSION, EQUIVALENCE, IMPLICIT, INTRINSIC, PARAMETER, POINTER,
SAVE, TARGET,
USE, VOLATILE, and type declaration statements.


So, I'd say commit a test case and close.  I don't think it is
worth chasing down which particular patch fixed this.

Reply via email to