• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1! RUN: %S/test_errors.sh %s %t %f18
2module m
3! C743 No component-attr-spec shall appear more than once in a
4! given component-def-stmt.
5!
6! R737 data-component-def-stmt ->
7!        declaration-type-spec [[, component-attr-spec-list] ::]
8!        component-decl-list
9!  component-attr-spec values are:
10!    PUBLIC, PRIVATE, ALLOCATABLE, CODIMENSION [*], CONTIGUOUS, DIMENSION(5),
11!      POINTER
12
13  type :: derived
14    !WARNING: Attribute 'PUBLIC' cannot be used more than once
15    real, public, allocatable, public :: field1
16    !WARNING: Attribute 'PRIVATE' cannot be used more than once
17    real, private, allocatable, private :: field2
18    !ERROR: Attributes 'PUBLIC' and 'PRIVATE' conflict with each other
19    real, public, allocatable, private :: field3
20    !WARNING: Attribute 'ALLOCATABLE' cannot be used more than once
21    real, allocatable, public, allocatable :: field4
22    !ERROR: Attribute 'CODIMENSION' cannot be used more than once
23    real, public, codimension[:], allocatable, codimension[:] :: field5
24    !WARNING: Attribute 'CONTIGUOUS' cannot be used more than once
25    real, public, contiguous, pointer, contiguous, dimension(:) :: field6
26    !ERROR: Attribute 'DIMENSION' cannot be used more than once
27    real, dimension(5), public, dimension(5) :: field7
28    !WARNING: Attribute 'POINTER' cannot be used more than once
29    real, pointer, public, pointer :: field8
30  end type derived
31
32end module m
33