public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch, fortran, testsuite, committed] Remove illegal code from substr_6.f90
@ 2018-03-30 12:18 Thomas Koenig
  0 siblings, 0 replies; only message in thread
From: Thomas Koenig @ 2018-03-30 12:18 UTC (permalink / raw)
  To: fortran, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

Hello world,

F2003, 6.1.1. "Substrings" states that

Both the starting point and the ending
point shall be within the range 1, 2, ..., n unless the starting point 
exceeds the ending point, in which
case the substring has length zero.

The attached patch, which corrects the test case, has
been committed as obvious.

What's left is the accepts-invalid bug.

Regards

	Thomas

2018-03-30  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/85130
	* gfortran.dg/substr_6.f90: Remove illegal test for
	out-of-bounds substring.

[-- Attachment #2: p_substr.diff --]
[-- Type: text/x-patch, Size: 412 bytes --]

Index: gfortran.dg/substr_6.f90
===================================================================
--- gfortran.dg/substr_6.f90	(Revision 258845)
+++ gfortran.dg/substr_6.f90	(Arbeitskopie)
@@ -6,8 +6,6 @@
 CHARACTER*5 c(1)
 CHARACTER(1), parameter :: c1(5) = (/ "1", "2", "3", ACHAR(0), "5" /)
 
-c = c0(1)(-5:-8)
-if (c(1) /= "     ") STOP 1
 c = (/ c0(1)(1:5) /)
 do i=1,5
    if (c(1)(i:i) /= c1(i)) STOP 2

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-03-30 12:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-30 12:18 [patch, fortran, testsuite, committed] Remove illegal code from substr_6.f90 Thomas Koenig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).