Merge from mainline.
[official-gcc.git] / gcc / testsuite / gfortran.dg / default_initialization.f90
blobfe67e2f5f885011acc169e59188b307c33788e67
2 ! { dg-do compile }
3 ! PR 20845
5 ! In ISO/IEC 1539-1:1997(E), 4th constraint in section 11.3:
7 ! If an object of a type for which component-initialization is specified
8 ! (R429) appears in the specification-part of a module and does not have
9 ! the ALLOCATABLE or POINTER attribute, the object shall have the SAVE
10 ! attribute.
12 module bad
13 implicit none
14 type default_initialization
15 integer :: x = 42
16 end type default_initialization
17 type (default_initialization) t ! { dg-error "default initialization" }
18 end module bad
20 ! { dg-final { cleanup-modules "bad" } }