[Bug fortran/43326] [OOP] dynamic dispatch with CLASS components

2010-04-20 Thread dominiq at lps dot ens dot fr


--- Comment #4 from dominiq at lps dot ens dot fr  2010-04-20 12:21 ---
Technically this PR, fixed on trunk but not on fortran-dev, is now a
[fortran-dev Regression]. Could it be marked that way?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43326



[Bug fortran/43326] [OOP] dynamic dispatch with CLASS components

2010-03-12 Thread pault at gcc dot gnu dot org


--- Comment #3 from pault at gcc dot gnu dot org  2010-03-12 22:01 ---
Subject: Bug 43326

Author: pault
Date: Fri Mar 12 22:00:52 2010
New Revision: 157411

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=157411
Log:
2010-03-12  Paul Thomas  pa...@gcc.gnu.org

PR fortran/43291
PR fortran/43326
* resolve.c (resolve_compcall): Add new boolean dummy argument
'class_members'. Only resolve expression at end if false.
Remove redundant, static variable 'class_object'.
(check_class_members): Add extra argument to call of
resolve_compcall.
(resolve_typebound_function): Renamed resolve_class_compcall.
Do all the detection of class references here. Correct calls to
resolve_compcall for extra argument.
(resolve_typebound_subroutine): resolve_class_typebound_call
renamed. Otherwise same as resolve_typebound_function.
(gfc_resolve_expr): Call resolve_typebound_function.
(resolve_code): Call resolve_typebound_subroutine.

2010-03-12  Paul Thomas  pa...@gcc.gnu.org

PR fortran/43291
PR fortran/43326
* gfortran.dg/dynamic_dispatch_7.f03: New test.

Added:
trunk/gcc/testsuite/gfortran.dg/dynamic_dispatch_7.f03
Modified:
trunk/gcc/fortran/ChangeLog
trunk/gcc/fortran/resolve.c
trunk/gcc/testsuite/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43326



[Bug fortran/43326] [OOP] dynamic dispatch with CLASS components

2010-03-10 Thread janus at gcc dot gnu dot org


--- Comment #1 from janus at gcc dot gnu dot org  2010-03-10 22:06 ---
Here is a simple-minded patch:

Index: gcc/fortran/resolve.c
===
--- gcc/fortran/resolve.c   (revision 157366)
+++ gcc/fortran/resolve.c   (working copy)
@@ -,6 +,8 @@
 gfc_resolve_expr (gfc_expr *e)
 {
   gfc_try t;
+  gfc_typespec ts;
+  gfc_ref *ref = NULL;

   if (e == NULL)
 return SUCCESS;
@@ -5584,7 +5586,14 @@
   break;

 case EXPR_COMPCALL:
-  if (e-symtree  e-symtree-n.sym-ts.type == BT_CLASS)
+  if (e-symtree)
+   ts = e-symtree-n.sym-ts;
+  for (ref = e-ref; ref; ref = ref-next)
+   {
+ if (ref-type == REF_COMPONENT)
+   ts = ref-u.c.component-ts;
+   }
+  if (ts.type == BT_CLASS)
t = resolve_class_compcall (e);
   else
t = resolve_compcall (e, true);


This fixes the test case. Haven't tested for regressions yet.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43326



[Bug fortran/43326] [OOP] dynamic dispatch with CLASS components

2010-03-10 Thread janus at gcc dot gnu dot org


--- Comment #2 from janus at gcc dot gnu dot org  2010-03-10 22:50 ---
(In reply to comment #1)
 This fixes the test case. Haven't tested for regressions yet.

Regtest was successful.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43326