+2019-01-31 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/88669
+ * resolve.c (resolve_component): If the reference is a BT_CLASS,
+ copy the contiguous attribute from the reference and use the
+ correct attributes.
+
2019-01-30 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/52564
resolve_component (gfc_component *c, gfc_symbol *sym)
{
gfc_symbol *super_type;
+ symbol_attribute *attr;
if (c->attr.artificial)
return true;
}
/* F2008, C448. */
- if (c->attr.contiguous && (!c->attr.dimension || !c->attr.pointer))
+ if (c->ts.type == BT_CLASS)
+ {
+ if (CLASS_DATA (c))
+ {
+ attr = &(CLASS_DATA (c)->attr);
+
+ /* Fix up contiguous attribute. */
+ if (c->attr.contiguous)
+ attr->contiguous = 1;
+ }
+ else
+ attr = NULL;
+ }
+ else
+ attr = &c->attr;
+
+ if (attr && attr->contiguous && (!attr->dimension || !attr->pointer))
{
gfc_error ("Component %qs at %L has the CONTIGUOUS attribute but "
"is not an array pointer", c->name, &c->loc);
+2019-01-31 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/88669
+ * gfortran.dg/contiguous_9.f90: New test.
+
2019-01-31 Marek Polacek <polacek@redhat.com>
PR c++/89083, c++/80864 - ICE with list initialization in template.
--- /dev/null
+program contiguous_pointer
+
+type t
+end type t
+
+type s
+ class(t), dimension(:), contiguous, pointer :: x ! OK
+ class(t), contiguous, allocatable :: y ! { dg-error "has the CONTIGUOUS attribute but is not an array pointer" }
+ class(t), contiguous, pointer :: z ! { dg-error "has the CONTIGUOUS attribute but is not an array pointer" }
+end type s
+
+end program contiguous_pointer