PR fortran/34662
* interface.c (compare_actual_formal): Reject parameter
actual to intent(out) dummy.
2008-01-06 Tobias Burnus <burnus@net-b.de>
PR fortran/34662
* gfortran.dg/intent_out_3.f90: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131348
138bc75d-0d04-0410-961f-
82ee72b054a4
+2008-01-06 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/34662
+ * interface.c (compare_actual_formal): Reject parameter
+ actual to intent(out) dummy.
+
2008-01-04 Tobias Burnus <burnus@net-b.de>
PR fortran/34557
}
/* Check intent = OUT/INOUT for definable actual argument. */
- if (a->expr->expr_type != EXPR_VARIABLE
+ if ((a->expr->expr_type != EXPR_VARIABLE
+ || a->expr->symtree->n.sym->attr.flavor != FL_VARIABLE)
&& (f->sym->attr.intent == INTENT_OUT
|| f->sym->attr.intent == INTENT_INOUT))
{
if (where)
- gfc_error ("Actual argument at %L must be definable to "
- "match dummy INTENT = OUT/INOUT", &a->expr->where);
+ gfc_error ("Actual argument at %L must be definable as "
+ "the dummy argument '%s' is INTENT = OUT/INOUT",
+ &a->expr->where, f->sym->name);
return 0;
}
+2008-01-06 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/34662
+ * gfortran.dg/intent_out_3.f90: New.
+
2008-01-05 Richard Sandiford <rsandifo@nildram.co.uk>
* objc.dg/stabs-1.m: Allow labels to be begin with $L as well as .L.
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/34662
+! The INTENT error was not detected.
+! Test case contributed by Joost VandeVondele.
+!
+MODULE M1
+ TYPE T1
+ INTEGER :: I(3)
+ END TYPE T1
+ TYPE(T1), PARAMETER :: D1=T1((/1,2,3/))
+CONTAINS
+ SUBROUTINE S1(J)
+ INTEGER, INTENT(INOUT) :: J
+ END SUBROUTINE S1
+END MODULE M1
+USE M1
+CALL S1(D1%I(3)) ! { dg-error "must be definable" }
+END