Commit 523ee218 by Jerry DeLisle

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
parent e2a02db7
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
......
......@@ -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 "
......
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
......
! { 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 }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment