[Bug fortran/50960] [OOP] vtables not marked as constant
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Nov 3 12:07:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50960
--- Comment #12 from janus at gcc dot gnu.org 2011-11-03 12:06:48 UTC ---
In summary, the combined patches of comment 1, comment 9 and comment 10:
Index: gcc/fortran/class.c
===================================================================
--- gcc/fortran/class.c (revision 180820)
+++ gcc/fortran/class.c (working copy)
@@ -424,7 +424,7 @@ gfc_find_derived_vtab (gfc_symbol *derived)
{
gfc_get_symbol (name, ns, &vtab);
vtab->ts.type = BT_DERIVED;
- if (gfc_add_flavor (&vtab->attr, FL_VARIABLE, NULL,
+ if (gfc_add_flavor (&vtab->attr, FL_PARAMETER, NULL,
&gfc_current_locus) == FAILURE)
goto cleanup;
vtab->attr.target = 1;
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 180820)
+++ gcc/fortran/resolve.c (working copy)
@@ -9503,7 +9503,7 @@ resolve_values (gfc_symbol *sym)
{
gfc_try t;
- if (sym->value == NULL)
+ if (sym->value == NULL || sym->attr.use_assoc)
return;
if (sym->value->expr_type == EXPR_STRUCTURE)
@@ -11971,7 +11971,7 @@ resolve_fl_parameter (gfc_symbol *sym)
/* Make sure the types of derived parameters are consistent. This
type checking is deferred until resolution because the type may
refer to a derived type from the host. */
- if (sym->ts.type == BT_DERIVED
+ if (sym->ts.type == BT_DERIVED && sym->value
&& !gfc_compare_types (&sym->ts, &sym->value->ts))
{
gfc_error ("Incompatible derived type in PARAMETER at %L",
show two remaining testsuite failures:
FAIL: gfortran.dg/extends_type_of_1.f03 -O0 (internal compiler error)
FAIL: gfortran.dg/extends_type_of_3.f90 -O (internal compiler error)
(cf. comment 11)
More information about the Gcc-bugs
mailing list