summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/structure_constructor_7.f03
blob: 5388e8805ebc9d4be9b3fd7083bd0f8d596b4a82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
! { dg-do compile }
! Test for errors when excess components are given for a structure-constructor.

PROGRAM test
  IMPLICIT NONE

  ! Structure of basic data types
  TYPE :: basics_t
    INTEGER :: i
    REAL :: r = 1.5
  END TYPE basics_t

  TYPE(basics_t) :: basics

  basics = basics_t (42, 1.5, 1000) ! { dg-error "Too many components" }
  basics = basics_t (42, xxx = 1000) ! { dg-error "is not a member" }

END PROGRAM test