[PATCH] Fortran : ProcPtr function results: 'ppr@' in error message PR39695

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] Fortran : ProcPtr function results: 'ppr@' in error message PR39695

Mark Eggleston
Please find attache a patch for PR39695

Commit message:

Fortran  : ProcPtr function results: 'ppr@' in error message PR39695

The value 'ppr@' is set in the name of result symbol, the actual
name of the symbol is in the procedure name symbol pointed
to by the result symbol's namespace (ns). When reporting errors for
symbols that have the proc_pointer attribute check whether the
result attribute is set and set the name accordingly.

2020-05-18  Mark Eggleston <[hidden email]>

gcc/fortran/

     PR fortran/39695
     * resolve.c (resolve_fl_procedure): Set name depending on
     whether the result attribute is set.  For PROCEDURE/RESULT
     conflict use the name in sym->ns->proc_name->name.
     * symbol.c (gfc_add_type): Add check for function and result
     attributes use sym->ns->proc_name->name if both are set.
     Where the symbol cannot have a type use the name in
     sym->ns->proc_name->name.

2020-05-18  Mark Eggleston <[hidden email]>

gcc/testsuite/

     PR fortran/39695
     * gfortran.dg/pr39695_1.f90: New test.
     * gfortran.dg/pr39695_2.f90: New test.
     * gfortran.dg/pr39695_3.f90: New test.
     * gfortran.dg/pr39695_4.f90: New test.

Tested on x86_64 using make check-fortran for master, gcc-8, gcc-9 and
gcc-10.

OK to to commit and backport?

--
https://www.codethink.co.uk/privacy.html