Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gfortran.dg/extends_6.f03 @ 127:4c56639505ff
fix function.c and add CbC-example Makefile
author | mir3636 |
---|---|
date | Wed, 11 Apr 2018 18:46:58 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
! { dg-do compile } ! Some errors pointed out in the development of the patch. ! ! Contributed by Tobias Burnus <burnus@net-b.de> ! module m type :: date private integer :: yr, mon integer,public :: day end type type :: dt integer :: yr, mon integer :: day end type end module m use m type, extends(date) :: datetime integer :: hr, min, sec end type type(datetime) :: o_dt type :: one integer :: i end type one type, extends(one) :: two real :: r end type two o_dt%day = 5 ! VALID but failed in first version of EXTENDS patch o_dt%yr = 5 ! { dg-error "is a PRIVATE component of" } t = two(one = one(4), i = 5, r=4.4) ! { dg-error "has already been set" } call foo contains subroutine foo use m, date_type => dt type, extends(date_type) :: dt_type end type type (dt_type) :: foo_dt foo_dt%date_type%day = 1 foo_dt%dt%day = 1 ! { dg-error "not a member" } end subroutine end