diff options
author | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-18 18:14:57 +0000 |
---|---|---|
committer | burnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-09-18 18:14:57 +0000 |
commit | 94ce0faed5f3c876ed0a8b73d3174f4e2d1d697a (patch) | |
tree | 800e25b834dfcf4e2501b24f9bce291d8109d684 /gcc/testsuite/gfortran.dg | |
parent | 8c56ff5235cfe1be4933ecae7947e505027cf645 (diff) | |
download | gcc-94ce0faed5f3c876ed0a8b73d3174f4e2d1d697a.tar.gz |
2013-09-15 Tobias Burnus <burnus@net-b.de>
PR fortran/43366
* primary.c (gfc_variable_attr): Also handle codimension.
* resolve.c (resolve_ordinary_assign): Add invalid-diagnostic
* for
polymorphic assignment.
2013-09-15 Tobias Burnus <burnus@net-b.de>
PR fortran/43366
* gfortran.dg/class_39.f03: Update dg-error.
* gfortran.dg/class_5.f03: Ditto.
* gfortran.dg/class_53.f90: Ditto.
* gfortran.dg/realloc_on_assign_20.f90: New.
* gfortran.dg/realloc_on_assign_21.f90: New.
* gfortran.dg/realloc_on_assign_22.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202713 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gfortran.dg')
-rw-r--r-- | gcc/testsuite/gfortran.dg/class_39.f03 | 2 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/class_5.f03 | 3 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/class_53.f90 | 2 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/realloc_on_assign_20.f90 | 13 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/realloc_on_assign_21.f90 | 13 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/realloc_on_assign_22.f90 | 13 |
6 files changed, 42 insertions, 4 deletions
diff --git a/gcc/testsuite/gfortran.dg/class_39.f03 b/gcc/testsuite/gfortran.dg/class_39.f03 index 6fe762ba35d..c29a3b06a63 100644 --- a/gcc/testsuite/gfortran.dg/class_39.f03 +++ b/gcc/testsuite/gfortran.dg/class_39.f03 @@ -8,6 +8,6 @@ end type T contains class(T) function add() ! { dg-error "must be dummy, allocatable or pointer" } - add = 1 ! { dg-error "Variable must not be polymorphic in intrinsic assignment" } + add = 1 ! { dg-error "Nonallocatable variable must not be polymorphic in intrinsic assignment" } end function end diff --git a/gcc/testsuite/gfortran.dg/class_5.f03 b/gcc/testsuite/gfortran.dg/class_5.f03 index 087d745aec7..0307cae4f89 100644 --- a/gcc/testsuite/gfortran.dg/class_5.f03 +++ b/gcc/testsuite/gfortran.dg/class_5.f03 @@ -20,7 +20,7 @@ x = t2(45,478) allocate(t2 :: cp) - cp = x ! { dg-error "Variable must not be polymorphic" } + cp = x ! { dg-error "Nonallocatable variable must not be polymorphic" } select type (cp) type is (t2) @@ -28,4 +28,3 @@ end select end -
\ No newline at end of file diff --git a/gcc/testsuite/gfortran.dg/class_53.f90 b/gcc/testsuite/gfortran.dg/class_53.f90 index 0a8c9620808..83f55712d0b 100644 --- a/gcc/testsuite/gfortran.dg/class_53.f90 +++ b/gcc/testsuite/gfortran.dg/class_53.f90 @@ -13,6 +13,6 @@ end type type(arr_t) :: this class(arr_t) :: elem ! { dg-error "must be dummy, allocatable or pointer" } -elem = this ! { dg-error "Variable must not be polymorphic in intrinsic assignment" } +elem = this ! { dg-error "Nonallocatable variable must not be polymorphic in intrinsic assignment" } end diff --git a/gcc/testsuite/gfortran.dg/realloc_on_assign_20.f90 b/gcc/testsuite/gfortran.dg/realloc_on_assign_20.f90 new file mode 100644 index 00000000000..d4cfaf841c6 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/realloc_on_assign_20.f90 @@ -0,0 +1,13 @@ +! { dg-do compile } +! { dg-options "-std=f2003" } +! +! PR fortran/43366 +! +! Invalid assignment to an allocatable polymorphic var. +! +type t +end type t +class(t), allocatable :: var + +var = t() ! { dg-error "Fortran 2008: Assignment to an allocatable polymorphic variable" } +end diff --git a/gcc/testsuite/gfortran.dg/realloc_on_assign_21.f90 b/gcc/testsuite/gfortran.dg/realloc_on_assign_21.f90 new file mode 100644 index 00000000000..fd8f9aca939 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/realloc_on_assign_21.f90 @@ -0,0 +1,13 @@ +! { dg-do compile } +! { dg-options "-fno-realloc-lhs" } +! +! PR fortran/43366 +! +! Invalid assignment to an allocatable polymorphic var. +! +type t +end type t +class(t), allocatable :: var + +var = t() ! { dg-error "Assignment to an allocatable polymorphic variable at .1. requires -frealloc-lhs" } +end diff --git a/gcc/testsuite/gfortran.dg/realloc_on_assign_22.f90 b/gcc/testsuite/gfortran.dg/realloc_on_assign_22.f90 new file mode 100644 index 00000000000..f759c6aca00 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/realloc_on_assign_22.f90 @@ -0,0 +1,13 @@ +! { dg-do compile } +! { dg-options "-fcoarray=single" } +! +! PR fortran/43366 +! +! Invalid assignment to an allocatable polymorphic var. +! +type t +end type t +class(t), allocatable :: caf[:] + +caf = t() ! { dg-error "Assignment to polymorphic coarray at .1. is not permitted" } +end |