[Bug fortran/47978] [OOP] Invalid INTENT in overriding TBP not detected
janus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Sep 8 14:57:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47978
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2011-09-08
AssignedTo|unassigned at gcc dot |janus at gcc dot gnu.org
|gnu.org |
Ever Confirmed|0 |1
--- Comment #3 from janus at gcc dot gnu.org 2011-09-08 14:47:09 UTC ---
Preliminary patch:
Index: gcc/fortran/interface.c
===================================================================
--- gcc/fortran/interface.c (revision 178664)
+++ gcc/fortran/interface.c (working copy)
@@ -3643,11 +3643,19 @@ gfc_check_typebound_override (gfc_symtree* proc, g
if (proc_pass_arg != argpos && old_pass_arg != argpos
&& !gfc_compare_types (&proc_formal->sym->ts, &old_formal->sym->ts))
{
- gfc_error ("Types mismatch for dummy argument '%s' of '%s' %L "
- "in respect to the overridden procedure",
+ gfc_error ("Types mismatch for dummy argument '%s' of '%s' at %L "
+ "with respect to the overridden procedure",
proc_formal->sym->name, proc->name, &where);
return FAILURE;
}
+ /* Check INTENT. */
+ if (proc_formal->sym->attr.intent != old_formal->sym->attr.intent)
+ {
+ gfc_error ("INTENT mismatch in argument '%s' of '%s' at %L "
+ "with respect to the overridden procedure",
+ proc_formal->sym->name, proc->name, &where);
+ return FAILURE;
+ }
++argpos;
}
More information about the Gcc-bugs
mailing list