User account creation filtered due to spam.

Bug 41648 - [OOP] Type-bound procedures refused
Summary: [OOP] Type-bound procedures refused
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.5.0
: P3 normal
Target Milestone: 4.5.0
Assignee: Paul Thomas
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2009-10-09 19:20 UTC by Salvatore Filippone
Modified: 2016-11-16 12:15 UTC (History)
3 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2009-10-13 07:33:38


Attachments
test case (260 bytes, text/plain)
2009-10-09 19:21 UTC, Salvatore Filippone
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Salvatore Filippone 2009-10-09 19:20:22 UTC
The attached code is not compiled correctly; gfortran accepts the subroutine but not the function. NAG 5.2 compiles cleanly. 

[sfilippo@localhost bug4]$ gfortran -v 
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/home/local/gnu45/bin/../libexec/gcc/i686-pc-linux-gnu/4.5.0/lto-wrapper
Target: i686-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/usr/local/gnu45 --enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.5.0 20091009 (experimental) (GCC) 
[sfilippo@localhost bug4]$ gfortran -c test-der4.f03 
test-der4.f03:45.10:

    res = a%a%getit()
          1
Error: Function 'getit' at (1) cannot be called recursively, as it is not RECURSIVE
Comment 1 Salvatore Filippone 2009-10-09 19:21:20 UTC
Created attachment 18769 [details]
test case
Comment 2 Paul Thomas 2009-10-13 07:33:38 UTC
Have just posted a patch for this

Paul
Comment 3 Paul Thomas 2009-10-16 06:07:24 UTC
Subject: Bug 41648

Author: pault
Date: Fri Oct 16 06:07:09 2009
New Revision: 152890

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=152890
Log:
2009-10-16  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/41648
	PR fortran/41656
	* trans-expr.c (select_class_proc): Convert the expression for the
	vindex, carried on the first member of the esym list.
	* gfortran.h : Add the vindex field to the esym_list structure.
	and eliminate the class_object field.
	* resolve.c (check_class_members): Remove the setting of the
	class_object field.
	(vindex_expr): New function.
	(get_class_from_expr): New function.
	(resolve_class_compcall): Call the above to find the ultimate
	class or derived component.  If derived, do not generate the
	esym list.  Add and expression for the vindex to the esym list
	by calling the above.
	(resolve_class_typebound_call): The same.

2009-10-16  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/41648
	* gfortran.dg/dynamic_dispatch_4.f03 : New test.

	PR fortran/41656
	* gfortran.dg/dynamic_dispatch_5.f03 : New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/dynamic_dispatch_4.f03
    trunk/gcc/testsuite/gfortran.dg/dynamic_dispatch_5.f03
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/fortran/trans-expr.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 Paul Thomas 2009-10-16 06:09:10 UTC
Fixed on trunk.

Thanks for the patch.

Paul