diff mbox

[Fortran,OOP] PR 59547: Problem with using tbp specification function in multiple class procedures

Message ID CAKwh3qiU41eROLcYO3rMg5vvuXsgZjSJ7Q2c84FY-RNhBf_OLA@mail.gmail.com
State New
Headers show

Commit Message

Janus Weil Dec. 22, 2013, 10:28 a.m. UTC
Hi all,

here is a patch for a rejects-valid problem with type-bound
procedures, which is due to the fact that the PURE attribute is being
propagated too late. (I'm not sure if this problem could show up also
with other attributes, so for now I'm only treating PURE.)

Regtested on x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus


2013-12-22  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/59547
    * class.c (add_proc_comp): Copy pure attribute.

2013-12-22  Janus Weil  <janus@gcc.gnu.org>

    PR fortran/59547
    * gfortran.dg/typebound_proc_32.f90: New.

Comments

Mikael Morin Jan. 3, 2014, 10:40 p.m. UTC | #1
Le 22/12/2013 11:28, Janus Weil a écrit :
> Hi all,
> 
> here is a patch for a rejects-valid problem with type-bound
> procedures, which is due to the fact that the PURE attribute is being
> propagated too late. (I'm not sure if this problem could show up also
> with other attributes, so for now I'm only treating PURE.)
> 
> Regtested on x86_64-unknown-linux-gnu. Ok for trunk?
> 
OK.

Mikael
Janus Weil Jan. 4, 2014, 9:42 a.m. UTC | #2
2014/1/3 Mikael Morin <mikael.morin@sfr.fr>:
> Le 22/12/2013 11:28, Janus Weil a écrit :
>> Hi all,
>>
>> here is a patch for a rejects-valid problem with type-bound
>> procedures, which is due to the fact that the PURE attribute is being
>> propagated too late. (I'm not sure if this problem could show up also
>> with other attributes, so for now I'm only treating PURE.)
>>
>> Regtested on x86_64-unknown-linux-gnu. Ok for trunk?
>>
> OK.

Thanks, Mikael. Committed as r206331.

Cheers,
Janus
diff mbox

Patch

Index: gcc/fortran/class.c
===================================================================
--- gcc/fortran/class.c	(revision 206161)
+++ gcc/fortran/class.c	(working copy)
@@ -714,9 +714,11 @@  add_proc_comp (gfc_symbol *vtype, const char *name
 
   if (tb->u.specific)
     {
-      c->ts.interface = tb->u.specific->n.sym;
+      gfc_symbol *ifc = tb->u.specific->n.sym;
+      c->ts.interface = ifc;
       if (!tb->deferred)
 	c->initializer = gfc_get_variable_expr (tb->u.specific);
+      c->attr.pure = ifc->attr.pure;
     }
 }