annotate gcc/testsuite/gfortran.dg/structure_constructor_6.f03 @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ! { dg-do compile }
kono
parents:
diff changeset
2 ! Structure constructor with default initialization, test that an error is
kono
parents:
diff changeset
3 ! emitted for components without default initializer missing value.
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 PROGRAM test
kono
parents:
diff changeset
6 IMPLICIT NONE
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 ! Structure of basic data types
kono
parents:
diff changeset
9 TYPE :: basics_t
kono
parents:
diff changeset
10 INTEGER :: i = 42
kono
parents:
diff changeset
11 REAL :: r
kono
parents:
diff changeset
12 COMPLEX :: c = (0., 1.)
kono
parents:
diff changeset
13 END TYPE basics_t
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 TYPE(basics_t) :: basics
kono
parents:
diff changeset
16
kono
parents:
diff changeset
17 basics = basics_t (i = 42) ! { dg-error "No initializer for component 'r'" }
kono
parents:
diff changeset
18 basics = basics_t (42) ! { dg-error "No initializer for component 'r'" }
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 END PROGRAM test