private_type_6.f90

来自「用于进行gcc测试」· F90 代码 · 共 26 行

F90
26
字号
! { dg-do compile }! PR fortran/32460!module foomod  implicit none  type :: footype    private    integer :: dummy  end type footype  TYPE :: bartype    integer :: dummy    integer, private :: dummy2  end type bartypeend module foomodprogram foo_test  USE foomod  implicit none  TYPE(footype) :: foo  TYPE(bartype) :: foo2  foo  = footype(1) ! { dg-error "has PRIVATE components" }  foo2 = bartype(1,2) ! { dg-error "has PRIVATE components" }  foo2%dummy2 = 5 ! { dg-error "is a PRIVATE component" }end program foo_test! { dg-final { cleanup-modules "foomod" } }

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?