class.c (gfc_find_intrinsic_vtab): Add _final component.
authorTobias Burnus <burnus@net-b.de>
Fri, 4 Jan 2013 21:48:21 +0000 (22:48 +0100)
committerTobias Burnus <burnus@gcc.gnu.org>
Fri, 4 Jan 2013 21:48:21 +0000 (22:48 +0100)
2013-01-04  Tobias Burnus  <burnus@net-b.de>

        * class.c (gfc_find_intrinsic_vtab): Add _final
        component.

From-SVN: r194917

gcc/fortran/ChangeLog
gcc/fortran/class.c
gcc/fortran/decl.c

index 4e1cf5598b99fd33491220bc79a464eb1ad34f5c..29216f967556eaa71c71a071a5433074d379da99 100644 (file)
@@ -1,3 +1,8 @@
+2013-01-04  Tobias Burnus  <burnus@net-b.de>
+
+       * class.c (gfc_find_intrinsic_vtab): Add _final
+       component.
+
 2013-01-04  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/55172
index 607af1090fd53e12bbc6cefd013e14ae250e8903..5f03d8954898b0ba3b9a6900e2cb81a3712394f5 100644 (file)
@@ -597,7 +597,7 @@ gfc_build_class_symbol (gfc_typespec *ts, symbol_attribute *attr,
       fclass->refs++;
       fclass->ts.type = BT_UNKNOWN;
       if (!ts->u.derived->attr.unlimited_polymorphic)
-      fclass->attr.abstract = ts->u.derived->attr.abstract;
+       fclass->attr.abstract = ts->u.derived->attr.abstract;
       fclass->f2k_derived = gfc_get_namespace (NULL, 0);
       if (gfc_add_flavor (&fclass->attr, FL_DERIVED,
          NULL, &gfc_current_locus) == FAILURE)
@@ -2306,6 +2306,15 @@ gfc_find_intrinsic_vtab (gfc_typespec *ts)
              /* Set initializer.  */
              c->initializer = gfc_lval_expr_from_sym (copy);
              c->ts.interface = copy;
+
+             /* Add component _final.  */
+             if (gfc_add_component (vtype, "_final", &c) == FAILURE)
+               goto cleanup;
+             c->attr.proc_pointer = 1;
+             c->attr.access = ACCESS_PRIVATE;
+             c->tb = XCNEW (gfc_typebound_proc);
+             c->tb->ppc = 1;
+             c->initializer = gfc_get_null_expr (NULL);
            }
          vtab->ts.u.derived = vtype;
          vtab->value = gfc_default_initializer (&vtab->ts);
index fc86efbafa608f6e9abdffcf385d07ebcdbc6f7f..2e6e98a1adad7937b577fe99e1ec475e0e964d7f 100644 (file)
@@ -1682,7 +1682,7 @@ gfc_match_null (gfc_expr **result)
       locus old_loc;
       char name[GFC_MAX_SYMBOL_LEN + 1];
 
-      if ((m2 = gfc_match (" null (", name)) != MATCH_YES)
+      if ((m2 = gfc_match (" null (")) != MATCH_YES)
        return m2;
 
       old_loc = gfc_current_locus;