re PR fortran/39998 (Procedure Pointer Assignments: Statement Functions & Internal Functions)
2009-05-05 Janus Weil <janus@gcc.gnu.org> PR fortran/39998 * expr.c (gfc_check_pointer_assign): Check for statement functions and internal procedures in procedure pointer assignments. 2009-05-05 Janus Weil <janus@gcc.gnu.org> PR fortran/39998 * gfortran.dg/proc_ptr_17.f90: New. From-SVN: r147133
This commit is contained in:
parent
2650d9e15a
commit
210aee68d4
@ -1,3 +1,9 @@
|
|||||||
|
2009-05-05 Janus Weil <janus@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR fortran/39998
|
||||||
|
* expr.c (gfc_check_pointer_assign): Check for statement functions and
|
||||||
|
internal procedures in procedure pointer assignments.
|
||||||
|
|
||||||
2009-04-28 Janus Weil <janus@gcc.gnu.org>
|
2009-04-28 Janus Weil <janus@gcc.gnu.org>
|
||||||
|
|
||||||
PR fortran/39946
|
PR fortran/39946
|
||||||
|
@ -3148,6 +3148,22 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
|
|||||||
rvalue->symtree->name, &rvalue->where);
|
rvalue->symtree->name, &rvalue->where);
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
/* Check for C727. */
|
||||||
|
if (attr.flavor == FL_PROCEDURE)
|
||||||
|
{
|
||||||
|
if (attr.proc == PROC_ST_FUNCTION)
|
||||||
|
{
|
||||||
|
gfc_error ("Statement function '%s' is invalid "
|
||||||
|
"in procedure pointer assignment at %L",
|
||||||
|
rvalue->symtree->name, &rvalue->where);
|
||||||
|
return FAILURE;
|
||||||
|
}
|
||||||
|
if (attr.proc == PROC_INTERNAL &&
|
||||||
|
gfc_notify_std (GFC_STD_F2008, "Internal procedure '%s' is "
|
||||||
|
"invalid in procedure pointer assignment at %L",
|
||||||
|
rvalue->symtree->name, &rvalue->where) == FAILURE)
|
||||||
|
return FAILURE;
|
||||||
|
}
|
||||||
if (rvalue->expr_type == EXPR_VARIABLE
|
if (rvalue->expr_type == EXPR_VARIABLE
|
||||||
&& !gfc_compare_interfaces (lvalue->symtree->n.sym,
|
&& !gfc_compare_interfaces (lvalue->symtree->n.sym,
|
||||||
rvalue->symtree->n.sym, 0))
|
rvalue->symtree->n.sym, 0))
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2009-05-05 Janus Weil <janus@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR fortran/39998
|
||||||
|
* gfortran.dg/proc_ptr_17.f90: New.
|
||||||
|
|
||||||
2009-05-05 Richard Guenther <rguenther@suse.de>
|
2009-05-05 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
PR tree-optimization/40022
|
PR tree-optimization/40022
|
||||||
|
16
gcc/testsuite/gfortran.dg/proc_ptr_17.f90
Normal file
16
gcc/testsuite/gfortran.dg/proc_ptr_17.f90
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
! { dg-do compile }
|
||||||
|
! { dg-options "-std=f2003" }
|
||||||
|
!
|
||||||
|
! PR39998: Procedure Pointer Assignments: Statement Functions & Internal Functions.
|
||||||
|
!
|
||||||
|
! Contributed by Tobias Burnus <burnus@net-b.de>
|
||||||
|
|
||||||
|
procedure(), pointer :: p
|
||||||
|
f(x) = x**2
|
||||||
|
p => f ! { dg-error "invalid in procedure pointer assignment" }
|
||||||
|
p => sub ! { dg-error "invalid in procedure pointer assignment" }
|
||||||
|
contains
|
||||||
|
subroutine sub
|
||||||
|
end subroutine sub
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user