From 6fd9c6f4c5bc16e598ffb51448e8810f9fbe4e4d Mon Sep 17 00:00:00 2001 From: Andre Vehreschild Date: Fri, 14 Oct 2016 10:52:10 +0200 Subject: [PATCH] coarray_38.f90: Expect error message. gcc/testsuite/ChangeLog: 2016-10-14 Andre Vehreschild * gfortran.dg/coarray_38.f90: Expect error message. gcc/fortran/ChangeLog: 2016-10-14 Andre Vehreschild * resolve.c (resolve_symbol): Add unimplemented message for polymorphic types with allocatable/pointer components and coarray=lib. From-SVN: r241150 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/resolve.c | 13 +++++++++++++ gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gfortran.dg/coarray_38.f90 | 2 +- 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 82ab03d..a3e1f49 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2016-10-14 Andre Vehreschild + + * resolve.c (resolve_symbol): Add unimplemented message for + polymorphic types with allocatable/pointer components and coarray=lib. + 2016-10-13 Thomas Preud'homme * trans-intrinsic.c: Include memmodel.h. diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 4645b57..e03979e 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -13787,6 +13787,19 @@ resolve_symbol (gfc_symbol *sym) (just like derived type declaration symbols have flavor FL_DERIVED). */ gcc_assert (sym->ts.type != BT_UNION); + /* Coarrayed polymorphic objects with allocatable or pointer components are + yet unsupported for -fcoarray=lib. */ + if (flag_coarray == GFC_FCOARRAY_LIB && sym->ts.type == BT_CLASS + && sym->ts.u.derived && CLASS_DATA (sym) + && CLASS_DATA (sym)->attr.codimension + && (sym->ts.u.derived->attr.alloc_comp + || sym->ts.u.derived->attr.pointer_comp)) + { + gfc_error ("Sorry, allocatable/pointer components in polymorphic (CLASS) " + "type coarrays at %L are unsupported", &sym->declared_at); + return; + } + if (sym->attr.artificial) return; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ce1b6fd..9596d77 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2016-10-14 Andre Vehreschild + + * gfortran.dg/coarray_38.f90: Expect error message. + 2016-10-14 Kyrylo Tkachov * gcc.target/aarch64/spellcheck_1.c: New test. diff --git a/gcc/testsuite/gfortran.dg/coarray_38.f90 b/gcc/testsuite/gfortran.dg/coarray_38.f90 index 31155c5..c8011d4 100644 --- a/gcc/testsuite/gfortran.dg/coarray_38.f90 +++ b/gcc/testsuite/gfortran.dg/coarray_38.f90 @@ -71,7 +71,7 @@ end type t type t2 class(t), allocatable :: caf2[:] end type t2 -class(t), allocatable :: caf[:] +class(t), allocatable :: caf[:] ! { dg-error "Sorry, allocatable/pointer components in polymorphic" } type(t) :: x type(t2) :: y -- 2.7.4