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/66257] [5/6 Regression] ELEMENTAL procedure pointer component XX is not allowed as an actual argument


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66257

Mikael Morin <mikael at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikael at gcc dot gnu.org

--- Comment #2 from Mikael Morin <mikael at gcc dot gnu.org> ---
Draft patch, not tested

diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index fbf260f..a46ab60 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -1981,7 +1981,8 @@ resolve_actual_arglist (gfc_actual_arglist *arg,
procedure_type ptype,
        }

       comp = gfc_get_proc_ptr_comp(e);
-      if (comp && comp->attr.elemental)
+      if (e->expr_type == EXPR_VARIABLE
+         && comp && comp->attr.elemental)
        {
            gfc_error ("ELEMENTAL procedure pointer component %qs is not "
                       "allowed as an actual argument at %L", comp->name,


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