(j3.2006) Default initialization and structure constructors

Van Snyder Van.Snyder
Mon Nov 21 22:33:34 EST 2016


Suppose I have two types:

  type :: T1
    integer :: i1 = 0
  end type T1

  type, extends(t1) :: T2
    integer :: I2 = 0
  end type T2

Is t2(i2=42) a valid structure constructor, or do I need t2(t1(),i2=42)?

C492 (12-007) says "A component-spec shall be provided for a
nonallocatable component unless it has default initialization...."

If the parent type has default initialization for every component, does
the parent component have default initialization?





More information about the J3 mailing list