Index: gcc/testsuite/gfortran.dg/typebound_operator_2.f03 =================================================================== --- gcc/testsuite/gfortran.dg/typebound_operator_2.f03 (Revision 152915) +++ gcc/testsuite/gfortran.dg/typebound_operator_2.f03 (Arbeitskopie) @@ -50,7 +50,6 @@ CONTAINS LOGICAL FUNCTION func (me, b) ! { dg-error "must be a SUBROUTINE" } CLASS(t), INTENT(OUT) :: me CLASS(t), INTENT(IN) :: b - me = t () func = .TRUE. END FUNCTION func Index: gcc/testsuite/gfortran.dg/typebound_operator_4.f03 =================================================================== --- gcc/testsuite/gfortran.dg/typebound_operator_4.f03 (Revision 152915) +++ gcc/testsuite/gfortran.dg/typebound_operator_4.f03 (Arbeitskopie) @@ -37,7 +37,7 @@ CONTAINS PURE SUBROUTINE assign_int (dest, from) CLASS(myint), INTENT(OUT) :: dest INTEGER, INTENT(IN) :: from - dest = myint (from) + dest%value = from END SUBROUTINE assign_int TYPE(myreal) FUNCTION add_real (a, b) @@ -49,7 +49,7 @@ CONTAINS SUBROUTINE assign_real (dest, from) CLASS(myreal), INTENT(OUT) :: dest REAL, INTENT(IN) :: from - dest = myreal (from) + dest%value = from END SUBROUTINE assign_real SUBROUTINE in_module () Index: gcc/fortran/resolve.c =================================================================== --- gcc/fortran/resolve.c (Revision 152915) +++ gcc/fortran/resolve.c (Arbeitskopie) @@ -7629,6 +7629,14 @@ resolve_ordinary_assign (gfc_code *code, gfc_names } } + /* F03:7.4.1.2. */ + if (lhs->ts.type == BT_CLASS) + { + gfc_error ("Variable must not be polymorphic in assignment at %L", + &lhs->where); + return false; + } + gfc_check_assign (lhs, rhs, 1); return false; }