Commit 78b0551a by Janus Weil

allocate_derived_1.f90: Re-enable class array checks, partially reverting r170092.

2012-09-30  Janus Weil  <janus@gcc.gnu.org> 

	* gfortran.dg/allocate_derived_1.f90: Re-enable class array checks,
	partially reverting r170092.
	* gfortran.dg/class_7.f03: Ditto.
	* gfortran.dg/coarray_14.f90: Ditto.
	* gfortran.dg/typebound_proc_13.f03: Ditto.

From-SVN: r191867
parent e8031ec5
2012-09-30 Janus Weil <janus@gcc.gnu.org>
* gfortran.dg/allocate_derived_1.f90: Re-enable class array checks,
partially reverting r170092.
* gfortran.dg/class_7.f03: Ditto.
* gfortran.dg/coarray_14.f90: Ditto.
* gfortran.dg/typebound_proc_13.f03: Ditto.
2012-09-29 Paolo Carlini <paolo.carlini@oracle.com> 2012-09-29 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54738 PR c++/54738
......
...@@ -24,28 +24,27 @@ ...@@ -24,28 +24,27 @@
real :: r real :: r
end type end type
! FIXME: uncomment and dejagnuify the lines below once class arrays are enabled class(t1),dimension(:),allocatable :: x
! class(t1),dimension(:),allocatable :: x
type(t2),dimension(:),allocatable :: y type(t2),dimension(:),allocatable :: y
! class(t3),dimension(:),allocatable :: z class(t3),dimension(:),allocatable :: z
! allocate( x(1)) allocate( x(1))
! allocate(t1 :: x(2)) allocate(t1 :: x(2))
! allocate(t2 :: x(3)) allocate(t2 :: x(3))
! allocate(t3 :: x(4)) allocate(t3 :: x(4))
! allocate(tx :: x(5)) ! { "Error in type-spec at" } allocate(tx :: x(5)) ! { dg-error "Error in type-spec at" }
! allocate(u0 :: x(6)) ! { "may not be ABSTRACT" } allocate(u0 :: x(6)) ! { dg-error "may not be ABSTRACT" }
! allocate(v1 :: x(7)) ! { "is type incompatible with typespec" } allocate(v1 :: x(7)) ! { dg-error "is type incompatible with typespec" }
allocate( y(1)) allocate( y(1))
allocate(t1 :: y(2)) ! { dg-error "is type incompatible with typespec" } allocate(t1 :: y(2)) ! { dg-error "is type incompatible with typespec" }
allocate(t2 :: y(3)) allocate(t2 :: y(3))
allocate(t3 :: y(3)) ! { dg-error "is type incompatible with typespec" } allocate(t3 :: y(3)) ! { dg-error "is type incompatible with typespec" }
! allocate( z(1)) allocate( z(1))
! allocate(t1 :: z(2)) ! { "is type incompatible with typespec" } allocate(t1 :: z(2)) ! { dg-error "is type incompatible with typespec" }
! allocate(t2 :: z(3)) ! { "is type incompatible with typespec" } allocate(t2 :: z(3)) ! { dg-error "is type incompatible with typespec" }
! allocate(t3 :: z(4)) allocate(t3 :: z(4))
end end
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
end type t0 end type t0
type t type t
integer :: i integer :: i
! FIXME: uncomment and dejagnuify once class arrays are enabled class(t0), allocatable :: foo(3) ! { dg-error "deferred shape" }
! class(t0), allocatable :: foo(3) ! { "deferred shape" }
end type t end type t
! PR41608: Would ICE on missing type decl ! PR41608: Would ICE on missing type decl
......
...@@ -47,7 +47,7 @@ end subroutine test ...@@ -47,7 +47,7 @@ end subroutine test
program myTest program myTest
type t type t
end type t end type t
type(t), allocatable :: a[:] class(t), allocatable :: a[:]
allocate (t :: a) ! { dg-error "Coarray specification required in ALLOCATE statement" } allocate (t :: a) ! { dg-error "Coarray specification required in ALLOCATE statement" }
allocate (t :: a[*]) ! OK allocate (t :: a[*]) ! OK
end program myTest end program myTest
...@@ -16,8 +16,7 @@ MODULE m ...@@ -16,8 +16,7 @@ MODULE m
TYPE t2 TYPE t2
CONTAINS CONTAINS
! FIXME: uncomment and dejagnuify once class arrays are enabled PROCEDURE, PASS :: nonscalar ! { dg-error "must be scalar" }
! PROCEDURE, PASS :: nonscalar ! { "must be scalar" }
PROCEDURE, PASS :: is_pointer ! { dg-error "must not be POINTER" } PROCEDURE, PASS :: is_pointer ! { dg-error "must not be POINTER" }
PROCEDURE, PASS :: is_allocatable ! { dg-error "must not be ALLOCATABLE" } PROCEDURE, PASS :: is_allocatable ! { dg-error "must not be ALLOCATABLE" }
END TYPE t2 END TYPE t2
...@@ -27,9 +26,9 @@ CONTAINS ...@@ -27,9 +26,9 @@ CONTAINS
SUBROUTINE myproc () SUBROUTINE myproc ()
END SUBROUTINE myproc END SUBROUTINE myproc
! SUBROUTINE nonscalar (me) SUBROUTINE nonscalar (me)
! CLASS(t2), INTENT(IN) :: me(:) CLASS(t2), INTENT(IN) :: me(:)
! END SUBROUTINE nonscalar END SUBROUTINE nonscalar
SUBROUTINE is_pointer (me) SUBROUTINE is_pointer (me)
CLASS(t2), POINTER, INTENT(IN) :: me CLASS(t2), POINTER, INTENT(IN) :: me
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment