Commit 6596e2fe by Janus Weil

re PR fortran/39930 (Bogus error: ambiguous reference)

2009-04-28  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39930
	PR fortran/39931
	* expr.c (gfc_check_pointer_assign): Correctly detect if the left hand
	side is a pointer.
	* parse.c (gfc_fixup_sibling_symbols): Don't check for ambiguity.


2009-04-28  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/39930
	PR fortran/39931
	* gfortran.dg/ambiguous_reference_2.f90: New.
	* gfortran.dg/pointer_assign_7.f90: New.

From-SVN: r146880
parent a6524a7c
2009-04-28 Janus Weil <janus@gcc.gnu.org>
PR fortran/39930
PR fortran/39931
* expr.c (gfc_check_pointer_assign): Correctly detect if the left hand
side is a pointer.
* parse.c (gfc_fixup_sibling_symbols): Don't check for ambiguity.
2009-04-28 Paul Thomas <pault@gcc.gnu.org>
PR fortran/39879
......
......@@ -3070,8 +3070,8 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
if (pointer)
check_intent_in = 0;
if (ref->type == REF_COMPONENT && ref->u.c.component->attr.pointer)
pointer = 1;
if (ref->type == REF_COMPONENT)
pointer = ref->u.c.component->attr.pointer;
if (ref->type == REF_ARRAY && ref->next == NULL)
{
......
......@@ -3310,7 +3310,7 @@ gfc_fixup_sibling_symbols (gfc_symbol *sym, gfc_namespace *siblings)
sym->attr.referenced = 1;
for (ns = siblings; ns; ns = ns->sibling)
{
gfc_find_sym_tree (sym->name, ns, 0, &st);
st = gfc_find_symtree (ns->sym_root, sym->name);
if (!st || (st->n.sym->attr.dummy && ns == st->n.sym->ns))
goto fixup_contained;
......
2009-04-28 Janus Weil <janus@gcc.gnu.org>
PR fortran/39930
PR fortran/39931
* gfortran.dg/ambiguous_reference_2.f90: New.
* gfortran.dg/pointer_assign_7.f90: New.
2009-04-28 Nathan Froyd <froydnj@codesourcery.com>
Mark Mitchell <mark@codesourcery.com>
......
! { dg-do compile }
!
! PR 39930: Bogus error: ambiguous reference
!
! Contributed by Janus Weil <janus@gcc.gnu.org>
module a1
contains
subroutine myRoutine
end subroutine
end module
module a2
contains
subroutine myRoutine
end subroutine
end module
module b
contains
subroutine otherRoutine
use a1
use a2
end subroutine
subroutine myRoutine
end subroutine myRoutine ! this is not ambiguous !
end module
! { dg-final { cleanup-modules "a1 a2 b" } }
! { dg-do compile }
!
! PR 39931: ICE on invalid Fortran 95 code (bad pointer assignment)
!
! Contributed by Thomas Orgis <thomas.orgis@awi.de>
program point_of_no_return
implicit none
type face_t
integer :: bla
end type
integer, pointer :: blu
type(face_t), pointer :: face
allocate(face)
allocate(blu)
face%bla => blu ! { dg-error "Pointer assignment to non-POINTER" }
end program
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment