summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gfortran.dg/extends_7.f03
blob: ebb2fcc3efb73cab530556a61f848e6d02a87470 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
! { dg-do compile }
! Check for re-definition of inherited components in the sub-type.

MODULE m1
  IMPLICIT NONE

  TYPE supert
    INTEGER :: c1
    INTEGER, PRIVATE :: c2
  END TYPE supert

END MODULE m1

MODULE m2
  USE m1 ! { dg-error "already in the parent type" }
  IMPLICIT NONE

  TYPE, EXTENDS(supert) :: subt
    INTEGER :: c1 ! { dg-error "already in the parent type" }
    INTEGER :: c2 ! { dg-error "already in the parent type" }
  END TYPE subt

END MODULE m2

! { dg-final { cleanup-modules "m1 m2" } }