aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2014-02-18 23:09:39 +0100
committerTobias Burnus <burnus@gcc.gnu.org>2014-02-18 23:09:39 +0100
commitab1668f602746b9753b7a4f6c334d98b2711af0c (patch)
treeacc9dd8a0b0f0ec03ea9b2c53b8b46e36c53652d /gcc/fortran/expr.c
parent70aacc9798fda3e38b42e04a57385f129c718837 (diff)
downloadgcc-ab1668f602746b9753b7a4f6c334d98b2711af0c.zip
gcc-ab1668f602746b9753b7a4f6c334d98b2711af0c.tar.gz
gcc-ab1668f602746b9753b7a4f6c334d98b2711af0c.tar.bz2
re PR fortran/49397 ([F03] ICE with proc pointer assignment)
2014-02-18 Tobias Burnus <burnus@net-b.de> PR fortran/49397 * expr.c (gfc_check_pointer_assign): Add check for F2008Cor2, C729. * trans-decl.c (gfc_get_symbol_decl): Correctly generate * external decl in a corner case. 2014-02-18 Tobias Burnus <burnus@net-b.de> PR fortran/49397 * gfortran.dg/proc_ptr_45.f90: New. * gfortran.dg/proc_ptr_46.f90: New. From-SVN: r207854
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 818212a..fe6eab5 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -3581,6 +3581,16 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
return false;
}
+ /* Check F2008Cor2, C729. */
+ if (!s2->attr.intrinsic && s2->attr.if_source == IFSRC_UNKNOWN
+ && !s2->attr.external && !s2->attr.subroutine && !s2->attr.function)
+ {
+ gfc_error ("Procedure pointer target '%s' at %L must be either an "
+ "intrinsic, host or use associated, referenced or have "
+ "the EXTERNAL attribute", s2->name, &rvalue->where);
+ return false;
+ }
+
return true;
}