annotate gcc/testsuite/gfortran.dg/structure_constructor_6.f03 @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900 (2020-05-25)
parents 04ced10e8804
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