re PR fortran/58026 ([F03] Bad error recovery for allocatable component of undeclared type)

2014-01-12  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/58026
	* decl.c (gfc_match_data_decl): Improve error recovery.


2014-01-12  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/58026
	* gfortran.dg/alloc_comp_basics_6.f90: New.

From-SVN: r206564
This commit is contained in:
Janus Weil 2014-01-12 12:08:31 +01:00
parent 915afe4494
commit a1b80ec7e0
4 changed files with 25 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2014-01-12 Janus Weil <janus@gcc.gnu.org>
PR fortran/58026
* decl.c (gfc_match_data_decl): Improve error recovery.
2014-01-09 Tobias Burnus <burnus@net-b.de>
* cpp.c (gfc_cpp_handle_option): Add missing break.

View File

@ -4287,12 +4287,10 @@ gfc_match_data_decl (void)
|| current_ts.u.derived->attr.zero_comp))
goto ok;
/* Now we have an error, which we signal, and then fix up
because the knock-on is plain and simple confusing. */
gfc_error_now ("Derived type at %C has not been previously defined "
"and so cannot appear in a derived type definition");
current_attr.pointer = 1;
goto ok;
gfc_error ("Derived type at %C has not been previously defined "
"and so cannot appear in a derived type definition");
m = MATCH_ERROR;
goto cleanup;
}
ok:

View File

@ -1,3 +1,8 @@
2014-01-12 Janus Weil <janus@gcc.gnu.org>
PR fortran/58026
* gfortran.dg/alloc_comp_basics_6.f90: New.
2014-01-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/59700

View File

@ -0,0 +1,11 @@
! { dg-do compile }
!
! PR 58026: Bad error recovery for allocatable component of undeclared type
!
! Contributed by Joost VandeVondele <Joost.VandeVondele@mat.ethz.ch>
type sysmtx_t
type(ext_complex_t), allocatable :: S(:) ! { dg-error "has not been previously defined" }
end type
end