This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/63552] [OOP] Type-bound procedures rejected as actual argument to dummy procedure
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 29 Dec 2014 14:02:12 +0000
- Subject: [Bug fortran/63552] [OOP] Type-bound procedures rejected as actual argument to dummy procedure
- Auto-submitted: auto-generated
- References: <bug-63552-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63552
--- Comment #3 from janus at gcc dot gnu.org ---
This draft patch gets rid of the error and regtests cleanly:
Index: gcc/fortran/primary.c
===================================================================
--- gcc/fortran/primary.c (Revision 219098)
+++ gcc/fortran/primary.c (Arbeitskopie)
@@ -1987,11 +1987,13 @@ gfc_match_varspec (gfc_expr *primary, int equiv_fl
{
if (sub_flag)
primary->value.compcall.actual = NULL;
- else
+ else if (!matching_actual_arglist)
{
gfc_error ("Expected argument list at %C");
return MATCH_ERROR;
}
+ else
+ primary->expr_type = EXPR_VARIABLE;
}
break;
However I then get another error on the test case in comment 0:
call co_reduce(a,x%tbp)
1
Error: OPERATOR argument at (1) must be a PURE function
This is obviously bogus since 'tbp' is bound to a PURE function. For the
commented-out line I get:
call co_reduce(a,x%ppc)
1 2
Fehler: A argument at (1) has type INTEGER(4) but the function passed as
OPERATOR at (2) returns REAL(4)
(which I guess is diagnosed correctly?)