From 83be3fe57d1ebaeff741cc6fec31488e94422986 Mon Sep 17 00:00:00 2001 From: Dominique d'Humieres Date: Tue, 17 Nov 2015 17:29:45 +0100 Subject: [PATCH] re PR fortran/65751 (Bogus &L in error message) 2015-11-17 Dominique d'Humieres PR fortran/65751 * expr.c (gfc_check_pointer_assign): Fix error message. * gfortran.dg/unlimited_polymorphic_2.f03: Update test. From-SVN: r230465 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/expr.c | 9 ++++----- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gfortran.dg/unlimited_polymorphic_2.f03 | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 9923fd4b467..e8e601ccac3 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2015-11-17 Dominique d'Humieres + + PR fortran/65751 + * expr.c (gfc_check_pointer_assign): Fix error message. + 2015-11-16 Steven G. Kargl PR fortran/58027 diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 28ea61a2330..7aaf0e252a0 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -3632,11 +3632,10 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue) || (lvalue->ts.type == BT_DERIVED && (lvalue->ts.u.derived->attr.is_bind_c || lvalue->ts.u.derived->attr.sequence)))) - gfc_error ("Data-pointer-object &L must be unlimited " - "polymorphic, a sequence derived type or of a " - "type with the BIND attribute assignment at %L " - "to be compatible with an unlimited polymorphic " - "target", &lvalue->where); + gfc_error ("Data-pointer-object at %L must be unlimited " + "polymorphic, or of a type with the BIND or SEQUENCE " + "attribute, to be compatible with an unlimited " + "polymorphic target", &lvalue->where); else gfc_error ("Different types in pointer assignment at %L; " "attempted assignment of %s to %s", &lvalue->where, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b8bb337b4d1..850758b45d6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-11-17 Dominique d'Humieres + + PR fortran/65751 + * gfortran.dg/unlimited_polymorphic_2.f03: Update test. + 2015-11-17 Ilya Enkovich PR middle-end/68134 diff --git a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_2.f03 b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_2.f03 index 5eea79dec77..13d7f8e466a 100644 --- a/gcc/testsuite/gfortran.dg/unlimited_polymorphic_2.f03 +++ b/gcc/testsuite/gfortran.dg/unlimited_polymorphic_2.f03 @@ -48,7 +48,7 @@ contains call foo (y) y => tgt ! This is OK, of course. - tgt => y ! { dg-error "must be unlimited polymorphic" } + tgt => y ! { dg-error "Data-pointer-object at .1. must be unlimited polymorphic" } select type (y) ! This is the correct way to accomplish the previous type is (integer) -- 2.30.2