2008-05-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gfortran.dg / structure_constructor_9.f90
blob75120856e139860224ae52b8d7691b6335d70733
1 ! { dg-do compile }
2 ! { dg-options "-std=f95" }
3 ! Check for notify-std-messages when F2003 structure constructors are compiled
4 ! with -std=f95.
6 PROGRAM test
7 IMPLICIT NONE
9 ! Basic type with default initializers
10 TYPE :: basics_t
11 INTEGER :: i = 42
12 REAL :: r = 1.5
13 END TYPE basics_t
15 TYPE(basics_t) :: basics
17 ! This is ok in F95
18 basics = basics_t (1, 2.)
20 ! No argument naming in F95
21 basics = basics_t (1, r = 4.2) ! { dg-error "Fortran 2003" }
23 ! No optional arguments in F95
24 basics = basics_t () ! { dg-error "Fortran 2003" }
25 basics = basics_t (5) ! { dg-error "Fortran 2003" }
27 END PROGRAM test