===================================================================
@@ -1258,7 +1258,8 @@ gfc_check_dependency (gfc_expr *expr1, g
&& strcmp (expr1->value.function.name, "_F.caf_get") == 0)
return 0;
- gcc_assert (expr1->expr_type == EXPR_VARIABLE);
+ if (expr1->expr_type != EXPR_VARIABLE)
+ gfc_internal_error ("gfc_check_dependency: expecting an EXPR_VARIABLE");
switch (expr2->expr_type)
{
===================================================================
@@ -0,0 +1,7 @@
+! { dg-do compile }
+program p
+ shape(1) = 0 ! { dg-error "expression in variable definition context" }
+ shape(1,2) = 0 ! { dg-error "expression in variable definition context" }
+ shape(1,2,3) = 0 ! { dg-error "Too many arguments in call" }
+ lbound([1]) = 0 ! { dg-error "expression in variable definition context" }
+end