re PR fortran/77972 (ICE on broken character continuation with -Wall etc.)

2016-10-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/77972
	* scanner.c (gfc_next_char_literal): If nextc is null do not
	decrement the pointer and call the diagnostics.

	PR fortran/77972
	* gfortran.dg/unexpected_eof_4.f90: New test.

From-SVN: r241201
This commit is contained in:
Jerry DeLisle 2016-10-15 18:38:54 +00:00
parent e2a02db769
commit 523ee218bb
4 changed files with 21 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2016-10-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/77972
* scanner.c (gfc_next_char_literal): If nextc is null do not
decrement the pointer and call the diagnostics.
2016-10-14 Andre Vehreschild <vehre@gcc.gnu.org>
* resolve.c (resolve_symbol): Add unimplemented message for

View File

@ -1414,10 +1414,9 @@ restart:
if (c != '&')
{
if (in_string)
if (in_string && gfc_current_locus.nextc)
{
if (gfc_current_locus.nextc)
gfc_current_locus.nextc--;
gfc_current_locus.nextc--;
if (warn_ampersand && in_string == INSTRING_WARN)
gfc_warning (OPT_Wampersand,
"Missing %<&%> in continued character "

View File

@ -1,3 +1,8 @@
2016-10-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/77972
* gfortran.dg/unexpected_eof_4.f90: New test.
2016-10-15 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/48587

View File

@ -0,0 +1,8 @@
! { dg-do compile }
! { dg-options "-Wampersand" }
! PR77972
program p
character(8) :: z
z = 'abc&
! { dg-error "Unterminated character constant" "" { target *-*-* } 0 }
! { dg-error "Unexpected end of file" "" { target *-*-* } 0 }