Summary: | [OOP] Wrongly importing a symbol into an interface without IMPORT | ||
---|---|---|---|
Product: | gcc | Reporter: | Tobias Burnus <burnus> |
Component: | fortran | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gcc-bugs, janus |
Priority: | P3 | Keywords: | accepts-invalid, diagnostic |
Version: | 4.6.0 | ||
Target Milestone: | 4.6.0 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2010-06-21 18:00:04 |
Description
Tobias Burnus
2010-06-21 16:39:02 UTC
Cf. also PR 44616 for the ICE reported at the mailing list. Confirmed. Changing the CLASS statement into TYPE gives the correct error: type(Connection) :: self 1 Error: the type of 'self' at (1) has not been declared within the interface Simple patch. Janus, if you have time, you can create a full patch out of it. Index: decl.c =================================================================== --- decl.c (revision 161227) +++ decl.c (working copy) @@ -1764,7 +1764,7 @@ variable_decl (int elem) specified in the procedure definition, except that the interface may specify a procedure that is not pure if the procedure is defined to be pure(12.3.2). */ - if (current_ts.type == BT_DERIVED + if ((current_ts.type == BT_DERIVED || current_ts.type == BT_CLASS) && gfc_current_ns->proc_name && gfc_current_ns->proc_name->attr.if_source == IFSRC_IFBODY && current_ts.u.derived->ns != gfc_current_ns) Subject: Bug 44614 Author: burnus Date: Thu Jun 24 07:51:22 2010 New Revision: 161310 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161310 Log: 2010-06-24 Tobias Burnus <burnus@net-b.de> PR fortran/44614 * decl.c (variable_decl): Fix IMPORT diagnostic for CLASS. 2010-06-24 Tobias Burnus <burnus@net-b.de> PR fortran/44614 * gfortran.dg/import8.f90: New. Added: trunk/gcc/testsuite/gfortran.dg/import8.f90 Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/decl.c trunk/gcc/testsuite/ChangeLog FIXED on the trunk (4.6). |