OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [typebound_override_2.f90] - Blame information for rev 749

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do compile }
2
!
3
! PR 47978: [OOP] Invalid INTENT in overriding TBP not detected
4
!
5
! Contributed by Salvatore Filippone 
6
 
7
module foo_mod
8
  type foo
9
  contains
10
    procedure, pass(f) :: bar => base_bar
11
  end type foo
12
contains
13
  subroutine base_bar(f,j)
14
    class(foo), intent(inout) :: f
15
    integer, intent(in)    :: j
16
  end subroutine base_bar
17
end module foo_mod
18
 
19
module extfoo_mod
20
  use foo_mod
21
  type, extends(foo) :: extfoo
22
  contains
23
    procedure, pass(f) :: bar => ext_bar  ! { dg-error "INTENT mismatch in argument" }
24
  end type extfoo
25
contains
26
  subroutine ext_bar(f,j)
27
    class(extfoo), intent(inout) :: f
28
    integer, intent(inout) :: j
29
  end subroutine ext_bar
30
end module extfoo_mod
31
 
32
! { dg-final { cleanup-modules "foo_mod extfoo_mod" } }

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.