aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2023-05-07 18:54:55 -0700
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2023-05-07 19:02:42 -0700
commitd46b3db4bd016a3eccfb933c81c7a9d87c0ad403 (patch)
tree44b616f7d43ad205ffc77b71d372281a0df66d34 /libgfortran
parent70d038235cc91ef1ea4fce519e628cfb2d297bff (diff)
downloadgcc-d46b3db4bd016a3eccfb933c81c7a9d87c0ad403.zip
gcc-d46b3db4bd016a3eccfb933c81c7a9d87c0ad403.tar.gz
gcc-d46b3db4bd016a3eccfb933c81c7a9d87c0ad403.tar.bz2
Fortran: Reject semicolon after namelist name.
PR fortran/109662 libgfortran/ChangeLog: * io/list_read.c: Add check for a semicolon after a namelist name in read input. Issue a runtime error message. gcc/testsuite/ChangeLog: * gfortran.dg/pr109662-a.f90: New test.
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/io/list_read.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index 78bfd9e..db33300 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -3598,9 +3598,9 @@ find_nml_name:
/* A trailing space is required, we allow a comma with std=gnu. */
c = next_char (dtp);
- if (c == ',' && !(compile_options.allow_std & GFC_STD_GNU))
+ if ((c == ',' && !(compile_options.allow_std & GFC_STD_GNU)) || c == ';')
generate_error (&dtp->common, LIBERROR_READ_VALUE,
- "Comma after namelist name not allowed");
+ "Non blank after namelist name not allowed");
if (!is_separator(c) && c != '!')
{