This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/43207] [OOP] invalid pointer assignment => type%parent
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 07 Nov 2012 22:26:18 +0000
- Subject: [Bug fortran/43207] [OOP] invalid pointer assignment => type%parent
- Auto-submitted: auto-generated
- References: <bug-43207-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43207
--- Comment #10 from janus at gcc dot gnu.org 2012-11-07 22:26:18 UTC ---
Here is a draft patch which rejects comment #1:
Index: gcc/fortran/primary.c
===================================================================
--- gcc/fortran/primary.c (revision 193296)
+++ gcc/fortran/primary.c (working copy)
@@ -2104,6 +2104,13 @@ check_substring:
}
}
+ /* F03:C611. */
+ if (primary->ts.type == BT_DERIVED && primary->ts.u.derived->attr.abstract)
+ {
+ gfc_error ("Nonpolymorphic reference to abstract type at %C");
+ return MATCH_ERROR;
+ }
+
/* F2008, C727. */
if (primary->expr_type == EXPR_PPC && gfc_is_coindexed (primary))
{