view gcc/testsuite/gfortran.dg/invalid_interface_assignment.f90 @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents 04ced10e8804
children
line wrap: on
line source

! { dg-do compile }
! { dg-options "-std=gnu" }
!
! Tests the fix for PR25102, which did not diagnose the aberrant interface
! assignement below.
!
! Contributed by Joost VandeVondele  <jv244@cam.ac.uk>
!
MODULE TT
 TYPE data_type
   INTEGER :: I
 END TYPE data_type
 INTERFACE ASSIGNMENT (=)
   MODULE PROCEDURE set
 END INTERFACE
CONTAINS
  PURE SUBROUTINE set(x1,*) ! { dg-error "Alternate return cannot appear" }
    TYPE(data_type), INTENT(OUT) :: x1
    x1%i=0
  END SUBROUTINE set
END MODULE