Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gfortran.dg/alloc_comp_constraint_5.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 } ! Check that ALLOCATABLE components aren't allowed to the right of a non-zero ! rank part reference. program test implicit none type :: foo real, allocatable :: bar(:) end type foo type(foo), target :: x(3) integer :: i real, pointer :: p(:) allocate(x(:)%bar(5))! { dg-error "must not have the ALLOCATABLE attribute" } x(:)%bar(1) = 1.0 ! { dg-error "must not have the ALLOCATABLE attribute" } p => x(:)%bar(1) ! { dg-error "must not have the ALLOCATABLE attribute" } end program test