mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-24 20:42:10 +08:00
re PR fortran/43244 (Invalid statement misinterpreted as FINAL declaration)
2010-03-04 Janus Weil <janus@gcc.gnu.org> PR fortran/43244 * decl.c (gfc_match_final_decl): Make sure variable names starting with 'final...' are not misinterpreted as FINAL statements. 2010-03-04 Janus Weil <janus@gcc.gnu.org> PR fortran/43244 * gfortran.dg/finalize_9.f90: New. From-SVN: r157226
This commit is contained in:
parent
9ca872365c
commit
33344e0feb
gcc
@ -1,3 +1,9 @@
|
||||
2010-03-04 Janus Weil <janus@gcc.gnu.org>
|
||||
|
||||
PR fortran/43244
|
||||
* decl.c (gfc_match_final_decl): Make sure variable names starting with
|
||||
'final...' are not misinterpreted as FINAL statements.
|
||||
|
||||
2010-03-03 Paul Thomas <pault@gcc.gnu.org>
|
||||
|
||||
PR fortran/43243
|
||||
|
@ -7810,8 +7810,18 @@ gfc_match_final_decl (void)
|
||||
bool first, last;
|
||||
gfc_symbol* block;
|
||||
|
||||
if (gfc_current_form == FORM_FREE)
|
||||
{
|
||||
char c = gfc_peek_ascii_char ();
|
||||
if (!gfc_is_whitespace (c) && c != ':')
|
||||
return MATCH_NO;
|
||||
}
|
||||
|
||||
if (gfc_state_stack->state != COMP_DERIVED_CONTAINS)
|
||||
{
|
||||
if (gfc_current_form == FORM_FIXED)
|
||||
return MATCH_NO;
|
||||
|
||||
gfc_error ("FINAL declaration at %C must be inside a derived type "
|
||||
"CONTAINS section");
|
||||
return MATCH_ERROR;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2010-03-04 Janus Weil <janus@gcc.gnu.org>
|
||||
|
||||
PR fortran/43244
|
||||
* gfortran.dg/finalize_9.f90: New.
|
||||
|
||||
2010-03-04 Tobias Burnus <burnus@net-b.de>
|
||||
Ken Werner <ken@linux.vnet.ibm.com>
|
||||
|
||||
|
13
gcc/testsuite/gfortran.dg/finalize_9.f90
Normal file
13
gcc/testsuite/gfortran.dg/finalize_9.f90
Normal file
@ -0,0 +1,13 @@
|
||||
! { dg-do compile }
|
||||
!
|
||||
! PR 43244: Invalid statement misinterpreted as FINAL declaration
|
||||
!
|
||||
! Contributed by Janus Weil <janus@gcc.gnu.org>
|
||||
|
||||
implicit none
|
||||
type particle
|
||||
integer :: ID
|
||||
end type
|
||||
type(particle), dimension(1,1:3) :: finalState
|
||||
finalstate(1,(/1:2/))%ID = (/1,103/) ! { dg-error "Syntax error in array constructor" }
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user