1! RUN: %S/test_errors.sh %s %t %flang_fc1
2! REQUIRES: shell
3module m
4! C730 The same type-attr-spec shall not appear more than once in a given
5! derived-type-stmt.
6!
7! R727 derived-type-stmt ->
8!        TYPE [[, type-attr-spec-list] ::] type-name [( type-param-name-list )]
9!  type-attr-spec values are:
10!    ABSTRACT, PUBLIC, PRIVATE, BIND(C), EXTENDS(parent-type-name)
11  !WARNING: Attribute 'ABSTRACT' cannot be used more than once
12  type, abstract, public, abstract :: derived1
13  end type derived1
14
15  !WARNING: Attribute 'PUBLIC' cannot be used more than once
16  type, public, abstract, public :: derived2
17  end type derived2
18
19  !WARNING: Attribute 'PRIVATE' cannot be used more than once
20  type, private, abstract, private :: derived3
21  end type derived3
22
23  !ERROR: Attributes 'PUBLIC' and 'PRIVATE' conflict with each other
24  type, public, abstract, private :: derived4
25  end type derived4
26
27  !WARNING: Attribute 'BIND(C)' cannot be used more than once
28  type, bind(c), public, bind(c) :: derived5
29  end type derived5
30
31  type, public :: derived6
32  end type derived6
33
34  !ERROR: Attribute 'EXTENDS' cannot be used more than once
35  type, extends(derived6), public, extends(derived6) :: derived7
36  end type derived7
37
38end module m
39