[Bug fortran/43207] [OOP] invalid pointer assignment = type%parent

2012-11-08 Thread janus at gcc dot gnu.org


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



--- Comment #11 from janus at gcc dot gnu.org 2012-11-08 09:25:39 UTC ---

(In reply to comment #10)

 Here is a draft patch which rejects comment #1:





This shows one testsuite failure:



FAIL: gfortran.dg/abstract_type_3.f03  -O   (test for errors, line 44)

FAIL: gfortran.dg/abstract_type_3.f03  -O  (test for excess errors)





where it correctly triggers on this line:



arg = again_abst_t () ! { dg-error Can't construct ABSTRACT type 'again_ab

1

Error: Nonpolymorphic reference to abstract type at (1)


[Bug fortran/43207] [OOP] invalid pointer assignment = type%parent

2012-11-07 Thread janus at gcc dot gnu.org


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



--- Comment #9 from janus at gcc dot gnu.org 2012-11-07 22:00:40 UTC ---

(In reply to comment #8)

 r159431 fixes the ICE. Comment #0 is now accepted without an error message.



With 4.7 and trunk, comment #0 is rejected with:



this_parent = this%parent  ! 

   1

Error: Pointer assignment target is neither TARGET nor POINTER at (1)





However, comment #1 is still accepted without error message.


[Bug fortran/43207] [OOP] invalid pointer assignment = type%parent

2012-11-07 Thread janus at gcc dot gnu.org


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))

 {


[Bug fortran/43207] [OOP] invalid pointer assignment = type%parent

2010-05-15 Thread janus at gcc dot gnu dot org


--- Comment #8 from janus at gcc dot gnu dot org  2010-05-15 14:08 ---
r159431 fixes the ICE. Comment #0 is now accepted without an error message.


-- 

janus at gcc dot gnu dot org changed:

   What|Removed |Added

   Keywords|ice-on-valid-code   |accepts-invalid
Summary|[OOP] ICE for class pointer |[OOP] invalid pointer
   |= null() initialization|assignment = type%parent


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