+2023-03-23 Tobias Burnus <tobias@codesourcery.com>
+
+ * class.cc (generate_callback_wrapper): Add attr.class_ok check.
+ * resolve.cc (resolve_fl_derived): Likewise.
+
2023-03-23 Tobias Burnus <tobias@codesourcery.com>
* trans-openmp.cc (gfc_trans_omp_clauses): Fix unmapping of
cb (token, comp->var(.data), size, 0, var's cb fn); */
for (gfc_component *comp = derived->components; comp; comp = comp->next)
{
+ if (__builtin_expect (comp->ts.type == BT_CLASS
+ && !comp->attr.class_ok, 0))
+ continue;
bool pointer = (comp->ts.type == BT_CLASS
? CLASS_DATA (comp)->attr.pointer : comp->attr.pointer);
bool proc_ptr = comp->attr.proc_pointer;
size->where = gfc_current_locus;
}
- if (!proc_ptr && comp->ts.type == BT_CLASS)
+ if (!proc_ptr && comp->ts.type == BT_CLASS && comp->attr.class_ok)
{
gfc_add_data_component (expr);
if (comp->attr.dimension)
gfc_component *c = (sym->attr.is_class
? CLASS_DATA (sym->components) : sym->components);
for ( ; c; c = c->next)
- if ((c->ts.type == BT_DERIVED || c->ts.type == BT_CLASS)
+ if ((c->ts.type == BT_DERIVED
+ || (c->ts.type == BT_CLASS && c->attr.class_ok))
&& !c->ts.u.derived->resolve_symbol_called)
{
if (c->ts.u.derived->components == NULL