Summary: | [OOP] Type Bound Procedure Error - Type Mismatch | ||
---|---|---|---|
Product: | gcc | Reporter: | ortp21 |
Component: | fortran | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | janus, mikael, ortp21 |
Priority: | P3 | Keywords: | rejects-valid |
Version: | 4.6.0 | ||
Target Milestone: | 4.6.4 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2010-10-01 09:40:38 |
Description
ortp21
2010-09-29 15:54:24 UTC
The problem is that the name of the module procedure is the same for both TBP; that's valid but seemingly does not work. Variant A: Without use-associating the ambiguous "sizeReturn" the program works: use A, only: a_type use B, only: b_type Variant B: Only importing one of the "sizeReturn" also works: use A, only: a_type use B, only: b_type, sizeReturn or use A, only: a_type use B However, using just use A use B or even use A, only: a_type, sizeReturn use B, only: b_type, sizeReturn does not. (This use associates both "sizeReturn", which is valid as long as one does use "sizeReturn"; if one would use the symbol, it's an error as the symbol is ambiguous.) Tobias, Thank you for the workaround variants. I have used them instead of what I was trying to do, with success. I hope the bug report was worthwhile/accurate. Author: mikael Date: Sun Jan 6 15:50:09 2013 New Revision: 194949 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=194949 Log: PR fortran/42769 PR fortran/45836 PR fortran/45900 * module.c (read_module): Don't reuse local symtree if the associated symbol isn't exactly the one wanted. Don't reuse local symtree if it is ambiguous. * resolve.c (resolve_call): Use symtree's name instead of symbol's to lookup the symtree. PR fortran/42769 PR fortran/45836 PR fortran/45900 * gfortran.dg/use_23.f90: New test. * gfortran.dg/use_24.f90: New test. * gfortran.dg/use_25.f90: New test. * gfortran.dg/use_26.f90: New test. * gfortran.dg/use_27.f90: New test. Added: trunk/gcc/testsuite/gfortran.dg/use_23.f90 trunk/gcc/testsuite/gfortran.dg/use_24.f90 trunk/gcc/testsuite/gfortran.dg/use_25.f90 trunk/gcc/testsuite/gfortran.dg/use_26.f90 trunk/gcc/testsuite/gfortran.dg/use_27.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/module.c trunk/gcc/fortran/resolve.c trunk/gcc/testsuite/ChangeLog Author: mikael Date: Tue Jan 8 19:42:38 2013 New Revision: 195031 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195031 Log: PR fortran/42769 PR fortran/45836 PR fortran/45900 * module.c (read_module): Don't reuse local symtree if the associated symbol isn't exactly the one wanted. Don't reuse local symtree if it is ambiguous. * resolve.c (resolve_call): Use symtree's name instead of symbol's to lookup the symtree. PR fortran/42769 PR fortran/45836 PR fortran/45900 * gfortran.dg/use_23.f90: New test. * gfortran.dg/use_24.f90: New test. * gfortran.dg/use_25.f90: New test. * gfortran.dg/use_26.f90: New test. * gfortran.dg/use_27.f90: New test. Added: branches/gcc-4_7-branch/gcc/testsuite/gfortran.dg/use_23.f90 branches/gcc-4_7-branch/gcc/testsuite/gfortran.dg/use_24.f90 branches/gcc-4_7-branch/gcc/testsuite/gfortran.dg/use_25.f90 branches/gcc-4_7-branch/gcc/testsuite/gfortran.dg/use_26.f90 branches/gcc-4_7-branch/gcc/testsuite/gfortran.dg/use_27.f90 Modified: branches/gcc-4_7-branch/gcc/fortran/ChangeLog branches/gcc-4_7-branch/gcc/fortran/module.c branches/gcc-4_7-branch/gcc/fortran/resolve.c branches/gcc-4_7-branch/gcc/testsuite/ChangeLog Author: mikael Date: Tue Jan 8 20:01:49 2013 New Revision: 195032 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195032 Log: PR fortran/42769 PR fortran/45836 PR fortran/45900 * module.c (read_module): Don't reuse local symtree if the associated symbol isn't exactly the one wanted. Don't reuse local symtree if it is ambiguous. * resolve.c (resolve_call): Use symtree's name instead of symbol's to lookup the symtree. PR fortran/42769 PR fortran/45836 PR fortran/45900 * gfortran.dg/use_23.f90: New test. * gfortran.dg/use_24.f90: New test. * gfortran.dg/use_25.f90: New test. * gfortran.dg/use_26.f90: New test. * gfortran.dg/use_27.f90: New test. Added: branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/use_23.f90 branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/use_24.f90 branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/use_25.f90 branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/use_26.f90 branches/gcc-4_6-branch/gcc/testsuite/gfortran.dg/use_27.f90 Modified: branches/gcc-4_6-branch/gcc/fortran/ChangeLog branches/gcc-4_6-branch/gcc/fortran/module.c branches/gcc-4_6-branch/gcc/fortran/resolve.c branches/gcc-4_6-branch/gcc/testsuite/ChangeLog Fixed for 4.6.4 4.7.3 4.8.0. Thanks for the bug report. |