https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71544

--- Comment #13 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
This looks like it does the trick (test case passes):

Index: trans-types.c
===================================================================
--- trans-types.c       (Revision 269260)
+++ trans-types.c       (Arbeitskopie)
@@ -1176,7 +1176,8 @@ gfc_typenode_for_spec (gfc_typespec * spec, int co
         {
           spec->type = BT_INTEGER;
           spec->kind = gfc_index_integer_kind;
-          spec->f90_type = BT_VOID;
+         spec->f90_type = BT_VOID;
+         spec->is_c_interop = 1;  /* Mark as escaping later.  */
         }
       break;
     case BT_VOID:
@@ -2957,7 +2958,8 @@ create_fn_spec (gfc_symbol *sym, tree fntype)
                    || f->sym->ts.u.derived->attr.pointer_comp))
            || (f->sym->ts.type == BT_CLASS
                && (CLASS_DATA (f->sym)->ts.u.derived->attr.proc_pointer_comp
-                   || CLASS_DATA (f->sym)->ts.u.derived->attr.pointer_comp)))
+                   || CLASS_DATA (f->sym)->ts.u.derived->attr.pointer_comp))
+           || (f->sym->ts.type == BT_INTEGER && f->sym->ts.is_c_interop))
          spec[spec_len++] = '.';
        else if (f->sym->attr.intent == INTENT_IN)
          spec[spec_len++] = 'r';

Reply via email to