2006-11-15 Tobias Burnus <burnus@net-b.de>
PR fortran/29806
* parse.c (parse_contained): Check for empty contains statement.
testsuite/
2006-11-15 Tobias Burnus <burnus@net-b.de>
PR fortran/29806
* gfortran.dg/contains.f90: New test.
* gfortran.dg/derived_function_interface_1.f90: Add a dg-warning.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@118851
138bc75d-0d04-0410-961f-
82ee72b054a4
+2006-11-15 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/29806
+ * parse.c (parse_contained): Check for empty contains statement.
+
2006-11-15 Bud Davis <bdavis9659@sbcglobal.net>
PR fortran/28974
gfc_statement st;
gfc_symbol *sym;
gfc_entry_list *el;
+ int contains_statements = 0;
push_state (&s1, COMP_CONTAINS, NULL);
parent_ns = gfc_current_ns;
case ST_FUNCTION:
case ST_SUBROUTINE:
+ contains_statements = 1;
accept_statement (st);
push_state (&s2,
gfc_free_namespace (ns);
pop_state ();
+ if (!contains_statements)
+ /* This is valid in Fortran 2008. */
+ gfc_notify_std (GFC_STD_GNU, "Extension: "
+ "CONTAINS statement without FUNCTION "
+ "or SUBROUTINE statement at %C");
}
+2006-11-15 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/29806
+ * gfortran.dg/contains.f90: New test.
+ * gfortran.dg/derived_function_interface_1.f90: Add a dg-warning.
+
2006-11-15 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/29581
--- /dev/null
+! { dg-do compile }
+! { dg-options "-std=f2003" }
+! Check whether empty contains are allowd
+! PR fortran/29806
+module x
+ contains
+end module x ! { dg-error "CONTAINS statement without FUNCTION or SUBROUTINE statement" }
+
+program y
+ contains
+end program y ! { dg-error "CONTAINS statement without FUNCTION or SUBROUTINE statement" }
type(foo) function fun() ! { dg-error "already has an explicit interface" }
end function fun ! { dg-error "Expecting END PROGRAM" }
-end
+end ! { dg-warning "CONTAINS statement without FUNCTION or SUBROUTINE statement" }