Commit 0149d8cc by Tobias Burnus Committed by Tobias Burnus

re PR fortran/46244 (gfc_compare_derived_types is buggy)

2010-11-10  Tobias Burnus <burnus@net-b.de>

        PR fortran/46244
        * resolve.c (resolve_fl_derived): Don't allow CLASS in
        sequence/BIND(C) types.

2010-11-10  Tobias Burnus <burnus@net-b.de>

        PR fortran/46244
        * gfortran.dg/class_30.f90: New.

From-SVN: r166547
parent 445f52e2
2010-11-10 Tobias Burnus <burnus@net-b.de>
PR fortran/46244
* resolve.c (resolve_fl_derived): Don't allow CLASS in
sequence/BIND(C) types.
2010-11-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Mikael Morin <mikael@gcc.gnu.org>
......
......@@ -11491,6 +11491,13 @@ resolve_fl_derived (gfc_symbol *sym)
sym->name, &sym->declared_at) == FAILURE)
return FAILURE;
if ((sym->attr.sequence || sym->attr.is_bind_c) && c->ts.type == BT_CLASS)
{
gfc_error ("Polymorphic component %s at %L in SEQUENCE or BIND(C) "
"type %s", c->name, &c->loc, sym->name);
return FAILURE;
}
if (sym->attr.sequence)
{
if (c->ts.type == BT_DERIVED && c->ts.u.derived->attr.sequence == 0)
......
2010-11-10 Tobias Burnus <burnus@net-b.de>
PR fortran/46244
* gfortran.dg/class_30.f90: New.
2010-11-10 Tobias Burnus <burnus@net-b.de>
PR fortran/46223
......
! { dg-do compile }
!
! PR fortran/46244 (comments 7 to 9)
!
! gfortran accepted CLASS in bind(C) and SEQUENCE types
!
type :: t
integer :: i
end type t
type t2
sequence
class(t), pointer :: x ! { dg-error "Polymorphic component x at .1. in SEQUENCE or BIND" }
end type t2
type, bind(C):: t3
class(t), pointer :: y ! { dg-error "may not be C interoperable|Polymorphic component y at .1. in SEQUENCE or BIND" }
end type t3
end
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