This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/63552] [OOP] Type-bound procedures rejected as actual argument to dummy procedure


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?)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]