public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch] Fortran: Accept -std=f2023 support, update line-length for Fortran 2023
@ 2023-11-16 13:01 Tobias Burnus
  2023-11-16 19:30 ` Harald Anlauf
  2023-11-17  3:38 ` [Patch] Fortran: Accept -std=f2023 support, " Jerry D
  0 siblings, 2 replies; 9+ messages in thread
From: Tobias Burnus @ 2023-11-16 13:01 UTC (permalink / raw)
  To: gcc-patches, fortran

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

This adds -std=f2023, which is mostly a prep patch for future changes.

However, Fortran 2023, https://j3-fortran.org/doc/year/23/23-007r1.pdf changes two things which is taken
care in this patch:

(A) In "6.3.2.1 Free form line length":

Fortran 2018: "If a line consists entirely of characters of default kind (7.4.4), it shall contain at most 132 characters"
Fortran 2023: "A line shall contain at most ten thousand characters."

(B) In "6.3.2.6 Free form statements":
Fortran 2018: "A statement shall not have more than 255 continuation lines."
Fortran 2023: "A statement shall not have more than one million characters."

I have not added a testcase for exceeding the latter but otherwise there are new
tests and I had to add a couple of -std=f2018 to existing tests.

Comments, suggestions, approval?

Tobias

PS: I find it funny that -std=c23, -std=c++23 and -std=f2023 will get added in the same GCC release.

PPS: I did not bother adding .f23 as file extension; I believe that also .f18 is unsupported.
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Attachment #2: std-f2023.diff --]
[-- Type: text/x-patch, Size: 152253 bytes --]

Fortran: Accept -std=f2023 support, update line-length for Fortran 2023

This patch accepts -std=f2023, uses it by default and bumps for the
free-source form the line length to 10,000 and the statement length
alias number of continuation lines to unlimited.

gcc/fortran/ChangeLog:

	* gfortran.texi (_gfortran_set_options): Document GFC_STD_F2023.
	* invoke.texi (std,pedantic,Wampersand,Wtabs): Add -std=2023.
	* lang.opt (std=f2023): Add.
	* libgfortran.h (GFC_STD_F2023, GFC_STD_OPT_F23): Add.
	* options.cc (set_default_std_flags): Add GFC_STD_F2023.
	(gfc_init_options): Set max_continue_free to 1,000,000.
	(gfc_post_options): Set flag_free_line_length if unset.
	(gfc_handle_option): Add OPT_std_f2023, set max_continue_free = 255
	for -std=f2003, f2008 and f2018.

gcc/testsuite/ChangeLog:

	* gfortran.dg/goacc/warn_truncated.f90: Add -std=f2018 option.
	* gfortran.dg/gomp/warn_truncated.f90: Likewise.
	* gfortran.dg/line_length_10.f90: Likewise.
	* gfortran.dg/line_length_11.f90: Likewise.
	* gfortran.dg/line_length_2.f90: Likewise.
	* gfortran.dg/line_length_5.f90: Likewise.
	* gfortran.dg/line_length_6.f90: Likewise.
	* gfortran.dg/line_length_7.f90: Likewise.
	* gfortran.dg/line_length_8.f90: Likewise.
	* gfortran.dg/line_length_9.f90: Likewise.
	* gfortran.dg/continuation_5.f90: New test.
	* gfortran.dg/continuation_6.f90: New test.
	* gfortran.dg/line_length_12.f90: New test.
	* gfortran.dg/line_length_13.f90: New test.
	* gfortran.dg/line_length_14.f90: New test.

 gcc/fortran/gfortran.texi                          |  11 +-
 gcc/fortran/invoke.texi                            |  21 +-
 gcc/fortran/lang.opt                               |   4 +
 gcc/fortran/libgfortran.h                          |   4 +-
 gcc/fortran/options.cc                             |  20 +-
 gcc/testsuite/gfortran.dg/continuation_5.f90       | 267 +++++++++++++++++++++
 gcc/testsuite/gfortran.dg/continuation_6.f90       | 267 +++++++++++++++++++++
 gcc/testsuite/gfortran.dg/goacc/warn_truncated.f90 |   1 +
 gcc/testsuite/gfortran.dg/gomp/warn_truncated.f90  |   1 +
 gcc/testsuite/gfortran.dg/line_length_10.f90       |   2 +-
 gcc/testsuite/gfortran.dg/line_length_11.f90       |   2 +-
 gcc/testsuite/gfortran.dg/line_length_12.f90       |  31 +++
 gcc/testsuite/gfortran.dg/line_length_13.f90       |  27 +++
 gcc/testsuite/gfortran.dg/line_length_14.f90       |  28 +++
 gcc/testsuite/gfortran.dg/line_length_2.f90        |   2 +-
 gcc/testsuite/gfortran.dg/line_length_5.f90        |   2 +-
 gcc/testsuite/gfortran.dg/line_length_6.f90        |   2 +-
 gcc/testsuite/gfortran.dg/line_length_7.f90        |   2 +-
 gcc/testsuite/gfortran.dg/line_length_8.f90        |   2 +-
 gcc/testsuite/gfortran.dg/line_length_9.f90        |   2 +-
 20 files changed, 672 insertions(+), 26 deletions(-)

diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index e7ffc294dc8..41857cc9038 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -3477,11 +3477,12 @@ standard.  Possible values are (bitwise or-ed) @code{GFC_STD_F77} (1),
 @code{GFC_STD_F95} (8), @code{GFC_STD_F2003} (16), @code{GFC_STD_GNU}
 (32), @code{GFC_STD_LEGACY} (64), @code{GFC_STD_F2008} (128),
 @code{GFC_STD_F2008_OBS} (256), @code{GFC_STD_F2008_TS} (512),
-@code{GFC_STD_F2018} (1024), @code{GFC_STD_F2018_OBS} (2048), and
-@code{GFC_STD=F2018_DEL} (4096). Default: @code{GFC_STD_F95_OBS |
-GFC_STD_F95_DEL | GFC_STD_F95 | GFC_STD_F2003 | GFC_STD_F2008 |
-GFC_STD_F2008_TS | GFC_STD_F2008_OBS | GFC_STD_F77 | GFC_STD_F2018 |
-GFC_STD_F2018_OBS | GFC_STD_F2018_DEL | GFC_STD_GNU | GFC_STD_LEGACY}.
+@code{GFC_STD_F2018} (1024), @code{GFC_STD_F2018_OBS} (2048),
+@code{GFC_STD=F2018_DEL} (4096), and @code{GFC_STD=F2023} (8192).
+Default: @code{GFC_STD_F95_OBS | GFC_STD_F95_DEL | GFC_STD_F95 |
+GFC_STD_F2003 | GFC_STD_F2008 | GFC_STD_F2008_TS | GFC_STD_F2008_OBS
+| GFC_STD_F77 | GFC_STD_F2018 | GFC_STD_F2018_OBS | GFC_STD_F2018_DEL
+| GFC_STD_F2023 | GFC_STD_GNU | GFC_STD_LEGACY}.
 @item @var{option}[1] @tab Standard-warning flag; prints a warning to
 standard error.  Default: @code{GFC_STD_F95_DEL | GFC_STD_LEGACY}.
 @item @var{option}[2] @tab If non zero, enable pedantic checking.
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 10387e39501..5f87b330a22 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -542,17 +542,17 @@ intermediate representation of the translated Fortran code, produced by
 @opindex @code{std=}@var{std} option
 @item -std=@var{std}
 Specify the standard to which the program is expected to conform,
-which may be one of @samp{f95}, @samp{f2003}, @samp{f2008},
-@samp{f2018}, @samp{gnu}, or @samp{legacy}.  The default value for
+which may be one of @samp{f95}, @samp{f2003}, @samp{f2008}, @samp{f2018},
+@samp{f2023}, @samp{gnu}, or @samp{legacy}.  The default value for
 @var{std} is @samp{gnu}, which specifies a superset of the latest
 Fortran standard that includes all of the extensions supported by GNU
 Fortran, although warnings will be given for obsolete extensions not
 recommended for use in new code.  The @samp{legacy} value is
 equivalent but without the warnings for obsolete extensions, and may
-be useful for old non-standard programs.  The @samp{f95},
-@samp{f2003}, @samp{f2008}, and @samp{f2018} values specify strict
-conformance to the Fortran 95, Fortran 2003, Fortran 2008 and Fortran
-2018 standards, respectively; errors are given for all extensions
+be useful for old non-standard programs.  The @samp{f95}, @samp{f2003},
+@samp{f2008}, @samp{f2018}, and @samp{f2023} values specify strict
+conformance to the Fortran 95, Fortran 2003, Fortran 2008, Fortran 2018
+and Fortran 2023 standards, respectively; errors are given for all extensions
 beyond the relevant language standard, and warnings are given for the
 Fortran 77 features that are permitted but obsolescent in later
 standards. The deprecated option @samp{-std=f2008ts} acts as an alias for
@@ -910,7 +910,8 @@ nonstandard practices, but not all.
 However, improvements to GNU Fortran in this area are welcome.
 
 This should be used in conjunction with @option{-std=f95},
-@option{-std=f2003}, @option{-std=f2008} or @option{-std=f2018}.
+@option{-std=f2003}, @option{-std=f2008}, @option{-std=f2018}
+or @option{-std=f2023}.
 
 @opindex @code{pedantic-errors}
 @item -pedantic-errors
@@ -958,8 +959,8 @@ The following example will trigger the warning.
 @item -Wampersand
 Warn about missing ampersand in continued character constants. The
 warning is given with @option{-Wampersand}, @option{-pedantic},
-@option{-std=f95}, @option{-std=f2003}, @option{-std=f2008} and
-@option{-std=f2018}. Note: With no ampersand given in a continued
+@option{-std=f95}, @option{-std=f2003}, @option{-std=f2008}, @option{-std=f2018}
+and @option{-std=f203}. Note: With no ampersand given in a continued
 character constant, GNU Fortran assumes continuation at the first
 non-comment, non-whitespace character after the ampersand that
 initiated the continuation.
@@ -1108,7 +1109,7 @@ of the Fortran Character Set.  For continuation lines, a tab followed
 by a digit between 1 and 9 is supported.  @option{-Wtabs} will cause a
 warning to be issued if a tab is encountered. Note, @option{-Wtabs} is
 active for @option{-pedantic}, @option{-std=f95}, @option{-std=f2003},
-@option{-std=f2008}, @option{-std=f2018} and
+@option{-std=f2008}, @option{-std=f2018}, @option{-std=f2023} and
 @option{-Wall}.
 
 @opindex @code{Wundefined-do-loop}
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index 7236351a93c..08c75394aa0 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -883,6 +883,10 @@ std=f2018
 Fortran
 Conform to the ISO Fortran 2018 standard.
 
+std=f2023
+Fortran
+Conform to the ISO Fortran 2023 standard.
+
 std=f95
 Fortran
 Conform to the ISO Fortran 95 standard.
diff --git a/gcc/fortran/libgfortran.h b/gcc/fortran/libgfortran.h
index cb84b59c99a..bdddb317ab0 100644
--- a/gcc/fortran/libgfortran.h
+++ b/gcc/fortran/libgfortran.h
@@ -19,9 +19,10 @@ along with GCC; see the file COPYING3.  If not see
 
 
 /* Flags to specify which standard/extension contains a feature.
-   Note that no features were obsoleted nor deleted in F2003.
+   Note that no features were obsoleted nor deleted in F2003 nor in F2023.
    Please remember to keep those definitions in sync with
    gfortran.texi.  */
+#define GFC_STD_F2023		(1<<12)	/* New in F2023.  */
 #define GFC_STD_F2018_DEL	(1<<11)	/* Deleted in F2018.  */
 #define GFC_STD_F2018_OBS	(1<<10)	/* Obsolescent in F2018.  */
 #define GFC_STD_F2018		(1<<9)	/* New in F2018.  */
@@ -45,6 +46,7 @@ along with GCC; see the file COPYING3.  If not see
 #define GFC_STD_OPT_F08		(GFC_STD_OPT_F03 | GFC_STD_F2008)
 #define GFC_STD_OPT_F18		((GFC_STD_OPT_F08 | GFC_STD_F2018) \
 				& (~GFC_STD_F2018_DEL))
+#define GFC_STD_OPT_F23		(GFC_STD_OPT_F18 | GFC_STD_F2023)
 
 /* Bitmasks for the various FPE that can be enabled.  These need to be straight integers
    e.g., 8 instead of (1<<3), because they will be included in Fortran source.  */
diff --git a/gcc/fortran/options.cc b/gcc/fortran/options.cc
index cfb195756a8..ffdc32769f1 100644
--- a/gcc/fortran/options.cc
+++ b/gcc/fortran/options.cc
@@ -57,7 +57,7 @@ set_default_std_flags (void)
   gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
     | GFC_STD_F2003 | GFC_STD_F2008 | GFC_STD_F95 | GFC_STD_F77
     | GFC_STD_F2008_OBS | GFC_STD_GNU | GFC_STD_LEGACY
-    | GFC_STD_F2018 | GFC_STD_F2018_DEL | GFC_STD_F2018_OBS;
+    | GFC_STD_F2018 | GFC_STD_F2018_DEL | GFC_STD_F2018_OBS | GFC_STD_F2023;
   gfc_option.warn_std = GFC_STD_F2018_DEL | GFC_STD_F95_DEL | GFC_STD_LEGACY;
 }
 
@@ -144,7 +144,7 @@ gfc_init_options (unsigned int decoded_options_count,
   gfc_option.module_dir = NULL;
   gfc_option.source_form = FORM_UNKNOWN;
   gfc_option.max_continue_fixed = 255;
-  gfc_option.max_continue_free = 255;
+  gfc_option.max_continue_free = 1000000;
   gfc_option.max_identifier_length = GFC_MAX_SYMBOL_LEN;
   gfc_option.max_errors = 25;
 
@@ -266,6 +266,10 @@ gfc_post_options (const char **pfilename)
 		       cpp_warn_missing_include_dirs, 1);
   gfc_check_include_dirs (verbose_missing_dir_warn);
 
+  SET_OPTION_IF_UNSET (&global_options, &global_options_set,
+		       flag_free_line_length,
+		       (gfc_option.allow_std & GFC_STD_F2023) ? 10000 : 132);
+
   /* Finalize DEC flags.  */
   post_dec_flags (flag_dec);
 
@@ -769,6 +773,7 @@ gfc_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
     case OPT_std_f2003:
       gfc_option.allow_std = GFC_STD_OPT_F03;
       gfc_option.warn_std = GFC_STD_F95_OBS;
+      gfc_option.max_continue_free = 255;
       gfc_option.max_identifier_length = 63;
       warn_ampersand = 1;
       warn_tabs = 1;
@@ -777,6 +782,7 @@ gfc_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
     case OPT_std_f2008:
       gfc_option.allow_std = GFC_STD_OPT_F08;
       gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS;
+      gfc_option.max_continue_free = 255;
       gfc_option.max_identifier_length = 63;
       warn_ampersand = 1;
       warn_tabs = 1;
@@ -785,6 +791,16 @@ gfc_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
     case OPT_std_f2008ts:
     case OPT_std_f2018:
       gfc_option.allow_std = GFC_STD_OPT_F18;
+      gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS
+	| GFC_STD_F2018_OBS;
+      gfc_option.max_continue_free = 255;
+      gfc_option.max_identifier_length = 63;
+      warn_ampersand = 1;
+      warn_tabs = 1;
+      break;
+
+    case OPT_std_f2023:
+      gfc_option.allow_std = GFC_STD_OPT_F23;
       gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS
 	| GFC_STD_F2018_OBS;
       gfc_option.max_identifier_length = 63;
diff --git a/gcc/testsuite/gfortran.dg/continuation_5.f90 b/gcc/testsuite/gfortran.dg/continuation_5.f90
new file mode 100644
index 00000000000..646c27c6dc6
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/continuation_5.f90
@@ -0,0 +1,267 @@
+! { dg-do compile }
+! { dg-options -std=f2018 }
+!
+! copied from continuation_4.f90 - but use -std=f2018
+! Fortran 2018: Limit is 255  <<< TESTED
+! Fortran 2023: No limit
+!
+! PR 19262  Test limit on line continuations. Test case derived form case in PR
+! by Steve Kargl.  Submitted by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+print *, &
+       "1" // & !  1  Counting in groups of 40.
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 40
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 80
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 120
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 160
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 200
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 240
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 255
+       "0"      ! { dg-warning "Limit of 255 continuations exceeded" }
+end
diff --git a/gcc/testsuite/gfortran.dg/continuation_6.f90 b/gcc/testsuite/gfortran.dg/continuation_6.f90
new file mode 100644
index 00000000000..28c90613523
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/continuation_6.f90
@@ -0,0 +1,267 @@
+! { dg-do compile }
+! { dg-options -std=f2023 }
+!
+! copied from continuation_4.f90 - but use -std=f2023
+! Fortran 2018: Limit is 255
+! Fortran 2023: No limit      <<< TESTED
+!
+! PR 19262  Test limit on line continuations. Test case derived form case in PR
+! by Steve Kargl.  Submitted by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+print *, &
+       "1" // & !  1  Counting in groups of 40.
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 40
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 80
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 120
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 160
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 200
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 240
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 255
+       "0" ! No warning with -std=f2023
+end
diff --git a/gcc/testsuite/gfortran.dg/goacc/warn_truncated.f90 b/gcc/testsuite/gfortran.dg/goacc/warn_truncated.f90
index 15ef3f513ae..101e026701d 100644
--- a/gcc/testsuite/gfortran.dg/goacc/warn_truncated.f90
+++ b/gcc/testsuite/gfortran.dg/goacc/warn_truncated.f90
@@ -1,4 +1,5 @@
 ! { dg-do compile }
+! { dg-additional-options "-std=f2018" }
 ! PR fortran/97390
 !
 integer :: tempRbuffer, array, compactHaloInfo, dimsizes, nHaloLayers, gpu_nList_send, gpu_idx_send, gpu_bufferOffset_send, counter
diff --git a/gcc/testsuite/gfortran.dg/gomp/warn_truncated.f90 b/gcc/testsuite/gfortran.dg/gomp/warn_truncated.f90
index 86d7eb27b30..20cd0449b9a 100644
--- a/gcc/testsuite/gfortran.dg/gomp/warn_truncated.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/warn_truncated.f90
@@ -1,4 +1,5 @@
 ! { dg-do compile }
+! { dg-additional-options "-std=f2018" }
 !
 ! PR fortran/94709
 !
diff --git a/gcc/testsuite/gfortran.dg/line_length_10.f90 b/gcc/testsuite/gfortran.dg/line_length_10.f90
index 390e9a16358..c244172e162 100644
--- a/gcc/testsuite/gfortran.dg/line_length_10.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_10.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-Wno-line-truncation" }
+! { dg-options "-std=f2018 -Wno-line-truncation" }
 !
 ! By default, for free-form source code: Error out
 ! But due to the explicit -Wno-line-truncation, compile w/o warning
diff --git a/gcc/testsuite/gfortran.dg/line_length_11.f90 b/gcc/testsuite/gfortran.dg/line_length_11.f90
index 67f1e29a0eb..2125f5458ea 100644
--- a/gcc/testsuite/gfortran.dg/line_length_11.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_11.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-Wno-all" }
+! { dg-options "-Wno-all -std=f2018" }
 !
 ! By default, for free-form source code: Error out
 ! But due to the explicit -Wno-all, compile w/o warning
diff --git a/gcc/testsuite/gfortran.dg/line_length_12.f90 b/gcc/testsuite/gfortran.dg/line_length_12.f90
new file mode 100644
index 00000000000..c8a935a027b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/line_length_12.f90
@@ -0,0 +1,31 @@
+! { dg-do compile }
+! { dg-additional-options "-std=f2018" }
+! { dg-prune-output "some warnings being treated as errors" }
+!
+! In Fortran 2018, the linelength is    132 characters.   <<<  Test this.
+! In Fortran 2023, the linelength is 10,000 characters.
+
+implicit none
+integer :: a, b, c, d
+
+a =  & ! The next line has 9,999 characters -> OK
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 + 42
+
+! { dg-error "Line truncated at .1. \\\[-Werror=line-truncation\\\]" "" { target *-*-* } .-2 }
+
+b =  & ! The next line has 10,000 characters -> OK
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +  42
+
+! { dg-error "Line truncated at .1. \\\[-Werror=line-truncation\\\]" "" { target *-*-* } .-2 }
+
+c =  & ! The next line has 10,001 characters -> TOO LONG
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 + 4242
+
+! { dg-error "Line truncated at .1. \\\[-Werror=line-truncation\\\]" "" { target *-*-* } .-2 }
+
+d =  & ! The next line has 10,002 characters -> TOO LONG
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 + 42424
+
+! { dg-error "Line truncated at .1. \\\[-Werror=line-truncation\\\]" "" { target *-*-* } .-2 }
+
+end 
diff --git a/gcc/testsuite/gfortran.dg/line_length_13.f90 b/gcc/testsuite/gfortran.dg/line_length_13.f90
new file mode 100644
index 00000000000..861eeb9c9be
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/line_length_13.f90
@@ -0,0 +1,27 @@
+! { dg-do compile }
+! { dg-additional-options "-std=f2023" }
+! { dg-prune-output "some warnings being treated as errors" }
+!
+! In Fortran 2018, the linelength is    132 characters.
+! In Fortran 2023, the linelength is 10,000 characters.   <<<  Test this.
+
+implicit none
+integer :: a, b, c, d
+
+a =  & ! The next line has 9,999 characters -> OK
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 + 42
+
+b =  & ! The next line has 10,000 characters -> OK
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +  42
+
+c =  & ! The next line has 10,001 characters -> TOO LONG
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 + 4242
+
+! { dg-error "Line truncated at .1. \\\[-Werror=line-truncation\\\]" "" { target *-*-* } .-2 }
+
+d =  & ! The next line has 10,002 characters -> TOO LONG
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 + 42424
+
+! { dg-error "Line truncated at .1. \\\[-Werror=line-truncation\\\]" "" { target *-*-* } .-2 }
+
+end 
diff --git a/gcc/testsuite/gfortran.dg/line_length_14.f90 b/gcc/testsuite/gfortran.dg/line_length_14.f90
new file mode 100644
index 00000000000..c4c66810d7a
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/line_length_14.f90
@@ -0,0 +1,28 @@
+! { dg-do compile }
+! { dg-prune-output "some warnings being treated as errors" }
+!
+! Implied -std=gnu
+!
+! In Fortran 2018, the linelength is    132 characters.
+! In Fortran 2023, the linelength is 10,000 characters.   <<<  Test this.
+
+implicit none
+integer :: a, b, c, d
+
+a =  & ! The next line has 9,999 characters -> OK
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 + 42
+
+b =  & ! The next line has 10,000 characters -> OK
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +  42
+
+c =  & ! The next line has 10,001 characters -> TOO LONG
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 + 4242
+
+! { dg-error "Line truncated at .1. \\\[-Werror=line-truncation\\\]" "" { target *-*-* } .-2 }
+
+d =  & ! The next line has 10,002 characters -> TOO LONG
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 + 42424
+
+! { dg-error "Line truncated at .1. \\\[-Werror=line-truncation\\\]" "" { target *-*-* } .-2 }
+
+end 
diff --git a/gcc/testsuite/gfortran.dg/line_length_2.f90 b/gcc/testsuite/gfortran.dg/line_length_2.f90
index e1ab7220d03..ff44d882257 100644
--- a/gcc/testsuite/gfortran.dg/line_length_2.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_2.f90
@@ -1,7 +1,7 @@
 ! Testcase for -ffree-line-length-none
 ! See PR fortran/21302
 ! { dg-do compile }
-! { dg-options "-ffree-line-length-none" }
+! { dg-options "-ffree-line-length-none -std=f2018" }
 program two
  if (abs(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa).gt.999.d0.or.abs(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb).gt.999.d0.or.abs(cccccccccccccccccccc).gt.999.d0) THEN
  endif
diff --git a/gcc/testsuite/gfortran.dg/line_length_5.f90 b/gcc/testsuite/gfortran.dg/line_length_5.f90
index 81832451ea2..ba9f2850b07 100644
--- a/gcc/testsuite/gfortran.dg/line_length_5.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_5.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-Wline-truncation" }
+! { dg-options "-std=f2018 -Wline-truncation" }
 print *, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
 end 
 ! { dg-error "Line truncated" " " { target *-*-* } 3 }
diff --git a/gcc/testsuite/gfortran.dg/line_length_6.f90 b/gcc/testsuite/gfortran.dg/line_length_6.f90
index 8cdb0209981..a88e2d247c0 100644
--- a/gcc/testsuite/gfortran.dg/line_length_6.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_6.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "" }
+! { dg-options "-std=f2018" }
 !
 ! By default, for free-form source code: Error out
 !
diff --git a/gcc/testsuite/gfortran.dg/line_length_7.f90 b/gcc/testsuite/gfortran.dg/line_length_7.f90
index b4ebf49c4bf..6c6d73b01c3 100644
--- a/gcc/testsuite/gfortran.dg/line_length_7.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_7.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-Wno-error" }
+! { dg-options "-std=f2018 -Wno-error" }
 !
 ! By default, for free-form source code: Error out
 ! But due to -Wno-error, we only expect a warning
diff --git a/gcc/testsuite/gfortran.dg/line_length_8.f90 b/gcc/testsuite/gfortran.dg/line_length_8.f90
index afd6cc2df46..822b09e803a 100644
--- a/gcc/testsuite/gfortran.dg/line_length_8.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_8.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-Wline-truncation" }
+! { dg-options "-std=f2018 -Wline-truncation" }
 !
 ! By default, for free-form source code: Error out
 ! Even with -Wline-truncation, we still get an error
diff --git a/gcc/testsuite/gfortran.dg/line_length_9.f90 b/gcc/testsuite/gfortran.dg/line_length_9.f90
index 6c156afc144..9f07d9a588e 100644
--- a/gcc/testsuite/gfortran.dg/line_length_9.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_9.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-Wall" }
+! { dg-options "-std=f2018 -Wall" }
 !
 ! By default, for free-form source code: Error out
 ! Even with -Wall, we still get an error

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Patch] Fortran: Accept -std=f2023 support, update line-length for Fortran 2023
  2023-11-16 13:01 [Patch] Fortran: Accept -std=f2023 support, update line-length for Fortran 2023 Tobias Burnus
@ 2023-11-16 19:30 ` Harald Anlauf
  2023-11-17 11:38   ` [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023 (was: [Patch] Fortran: Accept -std=f2023 support, update line-length for Fortran 2023) Tobias Burnus
  2023-11-17  3:38 ` [Patch] Fortran: Accept -std=f2023 support, " Jerry D
  1 sibling, 1 reply; 9+ messages in thread
From: Harald Anlauf @ 2023-11-16 19:30 UTC (permalink / raw)
  To: Tobias Burnus, gcc-patches, fortran

Hi Tobias,

On 11/16/23 14:01, Tobias Burnus wrote:
> This adds -std=f2023, which is mostly a prep patch for future changes.
>
> However, Fortran 2023, https://j3-fortran.org/doc/year/23/23-007r1.pdf
> changes two things which is taken
> care in this patch:
>
> (A) In "6.3.2.1 Free form line length":
>
> Fortran 2018: "If a line consists entirely of characters of default kind
> (7.4.4), it shall contain at most 132 characters"
> Fortran 2023: "A line shall contain at most ten thousand characters."
>
> (B) In "6.3.2.6 Free form statements":
> Fortran 2018: "A statement shall not have more than 255 continuation
> lines."
> Fortran 2023: "A statement shall not have more than one million
> characters."

this is really a funny change: we're not really prepared to handle
this.  According to the standard one can have 999999 lines with only
"&" and then an ";", but then only 100 lines with 10000 characters.

There is a similar wording for fixed-form which you overlooked:

6.3.3.5 Fixed form statements

Fortran 2023: "A statement shall not have more than one million characters"

Please adjust the fixed-form limits in your patch.

If you think that we need testcases for fixed-form, add them,
or forget them.  I don't bother.

> I have not added a testcase for exceeding the latter but otherwise there
> are new
> tests and I had to add a couple of -std=f2018 to existing tests.
>
> Comments, suggestions, approval?

I have the following comments:

- there are existing testcases continuation_5.f, continuation_6.f,
   thus I suggest to rename your new continuation_{5,6}.f90 to
   continuation_17.f90+ .

- I don't understand your new testcase line_length_14.f90 .
   This is supposed to test -std=gnu, but then -std=gnu is not a
   standard but a moving target, which is why you had to adjust
   existing testcases.
   So what does it buy us beyond line_length_1{2,3}.f90 ?

> Tobias
>
> PS: I find it funny that -std=c23, -std=c++23 and -std=f2023 will get
> added in the same GCC release.

:-)

> PPS: I did not bother adding .f23 as file extension; I believe that also
> .f18 is unsupported.

I never use extensions other than .f90 for portable code.

With the above fixed, I am fine with your patch.

Thanks,
Harald

> -----------------
> Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201,
> 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer:
> Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München;
> Registergericht München, HRB 106955


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Patch] Fortran: Accept -std=f2023 support, update line-length for Fortran 2023
  2023-11-16 13:01 [Patch] Fortran: Accept -std=f2023 support, update line-length for Fortran 2023 Tobias Burnus
  2023-11-16 19:30 ` Harald Anlauf
@ 2023-11-17  3:38 ` Jerry D
  1 sibling, 0 replies; 9+ messages in thread
From: Jerry D @ 2023-11-17  3:38 UTC (permalink / raw)
  To: fortran

On 11/16/23 5:01 AM, Tobias Burnus wrote:
> This adds -std=f2023, which is mostly a prep patch for future changes.
> 
> However, Fortran 2023, https://j3-fortran.org/doc/year/23/23-007r1.pdf 
> changes two things which is taken
> care in this patch:
> 
> (A) In "6.3.2.1 Free form line length":
> 
> Fortran 2018: "If a line consists entirely of characters of default kind 
> (7.4.4), it shall contain at most 132 characters"
> Fortran 2023: "A line shall contain at most ten thousand characters."
> 
> (B) In "6.3.2.6 Free form statements":
> Fortran 2018: "A statement shall not have more than 255 continuation 
> lines."
> Fortran 2023: "A statement shall not have more than one million 
> characters."
> 
> I have not added a testcase for exceeding the latter but otherwise there 
> are new
> tests and I had to add a couple of -std=f2018 to existing tests.
> 
> Comments, suggestions, approval?

My only comment is that the Standards Committee seems to have no idea of 
actual good coding practices. I have to assume they want this so people 
can have very very long DATA statements or array constructors or some 
such nonsense.

I always thought data files were for these sorts of things. The software 
engineers I work with would roll there eyes and say, "Hey you users out 
there, stop asking the compiler writers to fix your code for you by 
changing the compiler. Do your code correctly in the first place"

Perhaps AI is being used to generate the source files?

Cheers,

Jerry



^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023 (was: [Patch] Fortran: Accept -std=f2023 support, update line-length for Fortran 2023)
  2023-11-16 19:30 ` Harald Anlauf
@ 2023-11-17 11:38   ` Tobias Burnus
  2023-11-17 12:06     ` [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023 Mikael Morin
                       ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Tobias Burnus @ 2023-11-17 11:38 UTC (permalink / raw)
  To: Harald Anlauf, gcc-patches, fortran

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

Hi Harald, hi all,

On 16.11.23 20:30, Harald Anlauf wrote:
> On 11/16/23 14:01, Tobias Burnus wrote:
>> This adds -std=f2023, which is mostly a prep patch for future changes.
...
>> (B) In "6.3.2.6 Free form statements":
>> Fortran 2018: "A statement shall not have more than 255 continuation
>> lines."
>> Fortran 2023: "A statement shall not have more than one million
>> characters."
>
> this is really a funny change: we're not really prepared to handle
> this.

I can confirm this. I tried to get it working in scanner.cc but due to
the re-parsing it is quite difficult to get it right; the main problem
is that we keep reparsing code ("gfc_current_locus = old_loc"), such
that a simple count will be wrong.

→ Now tracked at https://gcc.gnu.org/PR112586


> According to the standard one can have 999999 lines with only
> "&" and then an ";", but then only 100 lines with 10000 characters.

I believe a single '&' is not valid, you either need '&&' or something
else + '&'; thus, you can have only half a million lines + 1.

In the code, I still use 1,000,000 but now with a comment.

> There is a similar wording for fixed-form which you overlooked:
Ups - fixed.
> If you think that we need testcases for fixed-form, add them,
> or forget them.  I don't bother.
I added one.

> - there are existing testcases continuation_5.f, continuation_6.f,
>   thus I suggest to rename your new continuation_{5,6}.f90 to
>   continuation_17.f90+ .

Done. We are rather inconsistent whether we enumerate <file>.f{,90}
together or separately; as the suffix is shown, either works.

>
> - I don't understand your new testcase line_length_14.f90 .
>   This is supposed to test -std=gnu, but then -std=gnu is not a
>   standard but a moving target, which is why you had to adjust
>   existing testcases.
>   So what does it buy us beyond line_length_1{2,3}.f90 ?

Well, it ensures that the warning is not only shown for -std=f2023 but
also for -std=f2028 and (current -std=gnu). In general, I think it is
useful to check the lower and the upper bound.

I have now removed it - as it is unlikely that we would regress on such
changes.

>> PPS: I did not bother adding .f23 as file extension; I believe that also
>> .f18 is unsupported.
> I never use extensions other than .f90 for portable code.

Likewise  - especially as '.f95' starts out as Fortran code that
complies to -std=f95 but slowly Fortran 2003 or later code creeps in. I
think that's fine but then one can also directly use .f90. (Most code
does so.)

Unless there are follow up comments, I will commit it later today.

Thanks for the comments!

Tobias

PS: I fixed the wording issue in the subject line of the email and
header. I first wrote 'support' but that sounded a bit as if F2023 is
supported. Hence, I wrote 'Accept' and did not remove 'support'.
-----------------
Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955

[-- Attachment #2: std-f2023-v3.diff --]
[-- Type: text/x-patch, Size: 115483 bytes --]

Fortran: Accept -std=f2023, update line-length for Fortran 2023

This patch accepts -std=f2023, uses it by default and bumps for the
free-source form the line length to 10,000 and the statement length
alias number of continuation lines to unlimited.

gcc/fortran/ChangeLog:

	* gfortran.texi (_gfortran_set_options): Document GFC_STD_F2023.
	* invoke.texi (std,pedantic,Wampersand,Wtabs): Add -std=2023.
	* lang.opt (std=f2023): Add.
	* libgfortran.h (GFC_STD_F2023, GFC_STD_OPT_F23): Add.
	* options.cc (set_default_std_flags): Add GFC_STD_F2023.
	(gfc_init_options): Set max_continue_free to 1,000,000.
	(gfc_post_options): Set flag_free_line_length if unset.
	(gfc_handle_option): Add OPT_std_f2023, set max_continue_free = 255
	for -std=f2003, f2008 and f2018.

gcc/testsuite/ChangeLog:

	* gfortran.dg/goacc/warn_truncated.f90: Add -std=f2018 option.
	* gfortran.dg/gomp/warn_truncated.f90: Likewise.
	* gfortran.dg/line_length_10.f90: Likewise.
	* gfortran.dg/line_length_11.f90: Likewise.
	* gfortran.dg/line_length_2.f90: Likewise.
	* gfortran.dg/line_length_5.f90: Likewise.
	* gfortran.dg/line_length_6.f90: Likewise.
	* gfortran.dg/line_length_7.f90: Likewise.
	* gfortran.dg/line_length_8.f90: Likewise.
	* gfortran.dg/line_length_9.f90: Likewise.
	* gfortran.dg/continuation_17.f90: New test.
	* gfortran.dg/continuation_18.f90: New test.
	* gfortran.dg/continuation_19.f: New test.
	* gfortran.dg/line_length_12.f90: New test.
	* gfortran.dg/line_length_13.f90: New test.

 gcc/fortran/gfortran.texi                          |  11 +-
 gcc/fortran/invoke.texi                            |  21 +-
 gcc/fortran/lang.opt                               |   4 +
 gcc/fortran/libgfortran.h                          |   4 +-
 gcc/fortran/options.cc                             |  28 ++-
 gcc/testsuite/gfortran.dg/continuation_17.f90      | 267 +++++++++++++++++++++
 gcc/testsuite/gfortran.dg/continuation_18.f90      | 267 +++++++++++++++++++++
 gcc/testsuite/gfortran.dg/continuation_19.f        | 267 +++++++++++++++++++++
 gcc/testsuite/gfortran.dg/goacc/warn_truncated.f90 |   1 +
 gcc/testsuite/gfortran.dg/gomp/warn_truncated.f90  |   1 +
 gcc/testsuite/gfortran.dg/line_length_10.f90       |   2 +-
 gcc/testsuite/gfortran.dg/line_length_11.f90       |   2 +-
 gcc/testsuite/gfortran.dg/line_length_12.f90       |  31 +++
 gcc/testsuite/gfortran.dg/line_length_13.f90       |  27 +++
 gcc/testsuite/gfortran.dg/line_length_2.f90        |   2 +-
 gcc/testsuite/gfortran.dg/line_length_5.f90        |   2 +-
 gcc/testsuite/gfortran.dg/line_length_6.f90        |   2 +-
 gcc/testsuite/gfortran.dg/line_length_7.f90        |   2 +-
 gcc/testsuite/gfortran.dg/line_length_8.f90        |   2 +-
 gcc/testsuite/gfortran.dg/line_length_9.f90        |   2 +-
 20 files changed, 918 insertions(+), 27 deletions(-)

diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi
index e7ffc294dc8..41857cc9038 100644
--- a/gcc/fortran/gfortran.texi
+++ b/gcc/fortran/gfortran.texi
@@ -3477,11 +3477,12 @@ standard.  Possible values are (bitwise or-ed) @code{GFC_STD_F77} (1),
 @code{GFC_STD_F95} (8), @code{GFC_STD_F2003} (16), @code{GFC_STD_GNU}
 (32), @code{GFC_STD_LEGACY} (64), @code{GFC_STD_F2008} (128),
 @code{GFC_STD_F2008_OBS} (256), @code{GFC_STD_F2008_TS} (512),
-@code{GFC_STD_F2018} (1024), @code{GFC_STD_F2018_OBS} (2048), and
-@code{GFC_STD=F2018_DEL} (4096). Default: @code{GFC_STD_F95_OBS |
-GFC_STD_F95_DEL | GFC_STD_F95 | GFC_STD_F2003 | GFC_STD_F2008 |
-GFC_STD_F2008_TS | GFC_STD_F2008_OBS | GFC_STD_F77 | GFC_STD_F2018 |
-GFC_STD_F2018_OBS | GFC_STD_F2018_DEL | GFC_STD_GNU | GFC_STD_LEGACY}.
+@code{GFC_STD_F2018} (1024), @code{GFC_STD_F2018_OBS} (2048),
+@code{GFC_STD=F2018_DEL} (4096), and @code{GFC_STD=F2023} (8192).
+Default: @code{GFC_STD_F95_OBS | GFC_STD_F95_DEL | GFC_STD_F95 |
+GFC_STD_F2003 | GFC_STD_F2008 | GFC_STD_F2008_TS | GFC_STD_F2008_OBS
+| GFC_STD_F77 | GFC_STD_F2018 | GFC_STD_F2018_OBS | GFC_STD_F2018_DEL
+| GFC_STD_F2023 | GFC_STD_GNU | GFC_STD_LEGACY}.
 @item @var{option}[1] @tab Standard-warning flag; prints a warning to
 standard error.  Default: @code{GFC_STD_F95_DEL | GFC_STD_LEGACY}.
 @item @var{option}[2] @tab If non zero, enable pedantic checking.
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index 10387e39501..5f87b330a22 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -542,17 +542,17 @@ intermediate representation of the translated Fortran code, produced by
 @opindex @code{std=}@var{std} option
 @item -std=@var{std}
 Specify the standard to which the program is expected to conform,
-which may be one of @samp{f95}, @samp{f2003}, @samp{f2008},
-@samp{f2018}, @samp{gnu}, or @samp{legacy}.  The default value for
+which may be one of @samp{f95}, @samp{f2003}, @samp{f2008}, @samp{f2018},
+@samp{f2023}, @samp{gnu}, or @samp{legacy}.  The default value for
 @var{std} is @samp{gnu}, which specifies a superset of the latest
 Fortran standard that includes all of the extensions supported by GNU
 Fortran, although warnings will be given for obsolete extensions not
 recommended for use in new code.  The @samp{legacy} value is
 equivalent but without the warnings for obsolete extensions, and may
-be useful for old non-standard programs.  The @samp{f95},
-@samp{f2003}, @samp{f2008}, and @samp{f2018} values specify strict
-conformance to the Fortran 95, Fortran 2003, Fortran 2008 and Fortran
-2018 standards, respectively; errors are given for all extensions
+be useful for old non-standard programs.  The @samp{f95}, @samp{f2003},
+@samp{f2008}, @samp{f2018}, and @samp{f2023} values specify strict
+conformance to the Fortran 95, Fortran 2003, Fortran 2008, Fortran 2018
+and Fortran 2023 standards, respectively; errors are given for all extensions
 beyond the relevant language standard, and warnings are given for the
 Fortran 77 features that are permitted but obsolescent in later
 standards. The deprecated option @samp{-std=f2008ts} acts as an alias for
@@ -910,7 +910,8 @@ nonstandard practices, but not all.
 However, improvements to GNU Fortran in this area are welcome.
 
 This should be used in conjunction with @option{-std=f95},
-@option{-std=f2003}, @option{-std=f2008} or @option{-std=f2018}.
+@option{-std=f2003}, @option{-std=f2008}, @option{-std=f2018}
+or @option{-std=f2023}.
 
 @opindex @code{pedantic-errors}
 @item -pedantic-errors
@@ -958,8 +959,8 @@ The following example will trigger the warning.
 @item -Wampersand
 Warn about missing ampersand in continued character constants. The
 warning is given with @option{-Wampersand}, @option{-pedantic},
-@option{-std=f95}, @option{-std=f2003}, @option{-std=f2008} and
-@option{-std=f2018}. Note: With no ampersand given in a continued
+@option{-std=f95}, @option{-std=f2003}, @option{-std=f2008}, @option{-std=f2018}
+and @option{-std=f203}. Note: With no ampersand given in a continued
 character constant, GNU Fortran assumes continuation at the first
 non-comment, non-whitespace character after the ampersand that
 initiated the continuation.
@@ -1108,7 +1109,7 @@ of the Fortran Character Set.  For continuation lines, a tab followed
 by a digit between 1 and 9 is supported.  @option{-Wtabs} will cause a
 warning to be issued if a tab is encountered. Note, @option{-Wtabs} is
 active for @option{-pedantic}, @option{-std=f95}, @option{-std=f2003},
-@option{-std=f2008}, @option{-std=f2018} and
+@option{-std=f2008}, @option{-std=f2018}, @option{-std=f2023} and
 @option{-Wall}.
 
 @opindex @code{Wundefined-do-loop}
diff --git a/gcc/fortran/lang.opt b/gcc/fortran/lang.opt
index 7236351a93c..08c75394aa0 100644
--- a/gcc/fortran/lang.opt
+++ b/gcc/fortran/lang.opt
@@ -883,6 +883,10 @@ std=f2018
 Fortran
 Conform to the ISO Fortran 2018 standard.
 
+std=f2023
+Fortran
+Conform to the ISO Fortran 2023 standard.
+
 std=f95
 Fortran
 Conform to the ISO Fortran 95 standard.
diff --git a/gcc/fortran/libgfortran.h b/gcc/fortran/libgfortran.h
index cb84b59c99a..bdddb317ab0 100644
--- a/gcc/fortran/libgfortran.h
+++ b/gcc/fortran/libgfortran.h
@@ -19,9 +19,10 @@ along with GCC; see the file COPYING3.  If not see
 
 
 /* Flags to specify which standard/extension contains a feature.
-   Note that no features were obsoleted nor deleted in F2003.
+   Note that no features were obsoleted nor deleted in F2003 nor in F2023.
    Please remember to keep those definitions in sync with
    gfortran.texi.  */
+#define GFC_STD_F2023		(1<<12)	/* New in F2023.  */
 #define GFC_STD_F2018_DEL	(1<<11)	/* Deleted in F2018.  */
 #define GFC_STD_F2018_OBS	(1<<10)	/* Obsolescent in F2018.  */
 #define GFC_STD_F2018		(1<<9)	/* New in F2018.  */
@@ -45,6 +46,7 @@ along with GCC; see the file COPYING3.  If not see
 #define GFC_STD_OPT_F08		(GFC_STD_OPT_F03 | GFC_STD_F2008)
 #define GFC_STD_OPT_F18		((GFC_STD_OPT_F08 | GFC_STD_F2018) \
 				& (~GFC_STD_F2018_DEL))
+#define GFC_STD_OPT_F23		(GFC_STD_OPT_F18 | GFC_STD_F2023)
 
 /* Bitmasks for the various FPE that can be enabled.  These need to be straight integers
    e.g., 8 instead of (1<<3), because they will be included in Fortran source.  */
diff --git a/gcc/fortran/options.cc b/gcc/fortran/options.cc
index cfb195756a8..b788521e816 100644
--- a/gcc/fortran/options.cc
+++ b/gcc/fortran/options.cc
@@ -57,7 +57,7 @@ set_default_std_flags (void)
   gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
     | GFC_STD_F2003 | GFC_STD_F2008 | GFC_STD_F95 | GFC_STD_F77
     | GFC_STD_F2008_OBS | GFC_STD_GNU | GFC_STD_LEGACY
-    | GFC_STD_F2018 | GFC_STD_F2018_DEL | GFC_STD_F2018_OBS;
+    | GFC_STD_F2018 | GFC_STD_F2018_DEL | GFC_STD_F2018_OBS | GFC_STD_F2023;
   gfc_option.warn_std = GFC_STD_F2018_DEL | GFC_STD_F95_DEL | GFC_STD_LEGACY;
 }
 
@@ -143,8 +143,11 @@ gfc_init_options (unsigned int decoded_options_count,
   gfc_source_file = NULL;
   gfc_option.module_dir = NULL;
   gfc_option.source_form = FORM_UNKNOWN;
-  gfc_option.max_continue_fixed = 255;
-  gfc_option.max_continue_free = 255;
+  /* The following is not quite right as Fortran since 2023 has: "A statement
+      shall not have more than one million characters."  This can already be
+      reached by 'just' 100 lines with 10,000 characters each.  */
+  gfc_option.max_continue_fixed = 1000000;
+  gfc_option.max_continue_free = 1000000;
   gfc_option.max_identifier_length = GFC_MAX_SYMBOL_LEN;
   gfc_option.max_errors = 25;
 
@@ -266,6 +269,10 @@ gfc_post_options (const char **pfilename)
 		       cpp_warn_missing_include_dirs, 1);
   gfc_check_include_dirs (verbose_missing_dir_warn);
 
+  SET_OPTION_IF_UNSET (&global_options, &global_options_set,
+		       flag_free_line_length,
+		       (gfc_option.allow_std & GFC_STD_F2023) ? 10000 : 132);
+
   /* Finalize DEC flags.  */
   post_dec_flags (flag_dec);
 
@@ -769,6 +776,8 @@ gfc_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
     case OPT_std_f2003:
       gfc_option.allow_std = GFC_STD_OPT_F03;
       gfc_option.warn_std = GFC_STD_F95_OBS;
+      gfc_option.max_continue_fixed = 255;
+      gfc_option.max_continue_free = 255;
       gfc_option.max_identifier_length = 63;
       warn_ampersand = 1;
       warn_tabs = 1;
@@ -777,6 +786,8 @@ gfc_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
     case OPT_std_f2008:
       gfc_option.allow_std = GFC_STD_OPT_F08;
       gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS;
+      gfc_option.max_continue_free = 255;
+      gfc_option.max_continue_fixed = 255;
       gfc_option.max_identifier_length = 63;
       warn_ampersand = 1;
       warn_tabs = 1;
@@ -785,6 +796,17 @@ gfc_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value,
     case OPT_std_f2008ts:
     case OPT_std_f2018:
       gfc_option.allow_std = GFC_STD_OPT_F18;
+      gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS
+	| GFC_STD_F2018_OBS;
+      gfc_option.max_continue_free = 255;
+      gfc_option.max_continue_fixed = 255;
+      gfc_option.max_identifier_length = 63;
+      warn_ampersand = 1;
+      warn_tabs = 1;
+      break;
+
+    case OPT_std_f2023:
+      gfc_option.allow_std = GFC_STD_OPT_F23;
       gfc_option.warn_std = GFC_STD_F95_OBS | GFC_STD_F2008_OBS
 	| GFC_STD_F2018_OBS;
       gfc_option.max_identifier_length = 63;
diff --git a/gcc/testsuite/gfortran.dg/continuation_17.f90 b/gcc/testsuite/gfortran.dg/continuation_17.f90
new file mode 100644
index 00000000000..6f2b11dbe4b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/continuation_17.f90
@@ -0,0 +1,267 @@
+! { dg-do compile }
+! { dg-options -std=f2018 }
+!
+! copied from continuation_4.f90 - but use -std=f2018
+! Fortran 2018: Continuation-line limit is 255  <<< TESTED
+! Fortran 2023: Maximally 1,000,000 characters per statement (implied but no explicit continuation-line line limit)
+!
+! PR 19262  Test limit on line continuations. Test case derived form case in PR
+! by Steve Kargl.  Submitted by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+print *, &
+       "1" // & !  1  Counting in groups of 40.
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 40
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 80
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 120
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 160
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 200
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 240
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 255
+       "0"      ! { dg-warning "Limit of 255 continuations exceeded" }
+end
diff --git a/gcc/testsuite/gfortran.dg/continuation_18.f90 b/gcc/testsuite/gfortran.dg/continuation_18.f90
new file mode 100644
index 00000000000..7ad887d7009
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/continuation_18.f90
@@ -0,0 +1,267 @@
+! { dg-do compile }
+! { dg-options -std=f2023 }
+!
+! copied from continuation_4.f90 - but use -std=f2023
+! Fortran 2018: Continuation-line limit is 255
+! Fortran 2023: Maximally 1,000,000 characters per statement (implied but no explicit continuation-line line limit)  <<< TESTED
+!
+! PR 19262  Test limit on line continuations. Test case derived form case in PR
+! by Steve Kargl.  Submitted by Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+print *, &
+       "1" // & !  1  Counting in groups of 40.
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 40
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 80
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 120
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 160
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 200
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 15
+       "6" // & ! 16
+       "7" // & ! 17
+       "8" // & ! 18
+       "9" // & ! 19
+       "0" // & ! 20
+       "1" // & ! 21
+       "2" // & ! 22
+       "3" // & ! 23
+       "4" // & ! 24
+       "5" // & ! 25
+       "6" // & ! 26
+       "7" // & ! 27
+       "8" // & ! 28
+       "9" // & ! 29
+       "0" // & ! 30
+       "1" // & ! 31
+       "2" // & ! 32
+       "3" // & ! 33
+       "4" // & ! 34
+       "5" // & ! 35
+       "6" // & ! 36
+       "7" // & ! 37
+       "8" // & ! 38
+       "9" // & ! 39
+       "0" // & ! 240
+       "1" // & !  1
+       "2" // & !  2
+       "3" // & !  3
+       "4" // & !  4
+       "5" // & !  5
+       "6" // & !  6
+       "7" // & !  7
+       "8" // & !  8
+       "9" // & !  9
+       "0" // & ! 10
+       "1" // & ! 11
+       "2" // & ! 12
+       "3" // & ! 13
+       "4" // & ! 14
+       "5" // & ! 255
+       "0" ! No warning with -std=f2023
+end
diff --git a/gcc/testsuite/gfortran.dg/continuation_19.f b/gcc/testsuite/gfortran.dg/continuation_19.f
new file mode 100644
index 00000000000..2b32a333fdc
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/continuation_19.f
@@ -0,0 +1,267 @@
+! { dg-do run }
+! { dg-options "-std=f2023" }
+
+      implicit none
+      integer :: x
+
+      ! 256 continuation lines - but less than 1,000,000 character
+      ! => Valid since Fortran 2023
+      x =
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+     & + 2
+
+      end
diff --git a/gcc/testsuite/gfortran.dg/goacc/warn_truncated.f90 b/gcc/testsuite/gfortran.dg/goacc/warn_truncated.f90
index 15ef3f513ae..101e026701d 100644
--- a/gcc/testsuite/gfortran.dg/goacc/warn_truncated.f90
+++ b/gcc/testsuite/gfortran.dg/goacc/warn_truncated.f90
@@ -1,4 +1,5 @@
 ! { dg-do compile }
+! { dg-additional-options "-std=f2018" }
 ! PR fortran/97390
 !
 integer :: tempRbuffer, array, compactHaloInfo, dimsizes, nHaloLayers, gpu_nList_send, gpu_idx_send, gpu_bufferOffset_send, counter
diff --git a/gcc/testsuite/gfortran.dg/gomp/warn_truncated.f90 b/gcc/testsuite/gfortran.dg/gomp/warn_truncated.f90
index 86d7eb27b30..20cd0449b9a 100644
--- a/gcc/testsuite/gfortran.dg/gomp/warn_truncated.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/warn_truncated.f90
@@ -1,4 +1,5 @@
 ! { dg-do compile }
+! { dg-additional-options "-std=f2018" }
 !
 ! PR fortran/94709
 !
diff --git a/gcc/testsuite/gfortran.dg/line_length_10.f90 b/gcc/testsuite/gfortran.dg/line_length_10.f90
index 390e9a16358..c244172e162 100644
--- a/gcc/testsuite/gfortran.dg/line_length_10.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_10.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-Wno-line-truncation" }
+! { dg-options "-std=f2018 -Wno-line-truncation" }
 !
 ! By default, for free-form source code: Error out
 ! But due to the explicit -Wno-line-truncation, compile w/o warning
diff --git a/gcc/testsuite/gfortran.dg/line_length_11.f90 b/gcc/testsuite/gfortran.dg/line_length_11.f90
index 67f1e29a0eb..2125f5458ea 100644
--- a/gcc/testsuite/gfortran.dg/line_length_11.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_11.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-Wno-all" }
+! { dg-options "-Wno-all -std=f2018" }
 !
 ! By default, for free-form source code: Error out
 ! But due to the explicit -Wno-all, compile w/o warning
diff --git a/gcc/testsuite/gfortran.dg/line_length_12.f90 b/gcc/testsuite/gfortran.dg/line_length_12.f90
new file mode 100644
index 00000000000..c8a935a027b
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/line_length_12.f90
@@ -0,0 +1,31 @@
+! { dg-do compile }
+! { dg-additional-options "-std=f2018" }
+! { dg-prune-output "some warnings being treated as errors" }
+!
+! In Fortran 2018, the linelength is    132 characters.   <<<  Test this.
+! In Fortran 2023, the linelength is 10,000 characters.
+
+implicit none
+integer :: a, b, c, d
+
+a =  & ! The next line has 9,999 characters -> OK
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 + 42
+
+! { dg-error "Line truncated at .1. \\\[-Werror=line-truncation\\\]" "" { target *-*-* } .-2 }
+
+b =  & ! The next line has 10,000 characters -> OK
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +  42
+
+! { dg-error "Line truncated at .1. \\\[-Werror=line-truncation\\\]" "" { target *-*-* } .-2 }
+
+c =  & ! The next line has 10,001 characters -> TOO LONG
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 + 4242
+
+! { dg-error "Line truncated at .1. \\\[-Werror=line-truncation\\\]" "" { target *-*-* } .-2 }
+
+d =  & ! The next line has 10,002 characters -> TOO LONG
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 + 42424
+
+! { dg-error "Line truncated at .1. \\\[-Werror=line-truncation\\\]" "" { target *-*-* } .-2 }
+
+end 
diff --git a/gcc/testsuite/gfortran.dg/line_length_13.f90 b/gcc/testsuite/gfortran.dg/line_length_13.f90
new file mode 100644
index 00000000000..861eeb9c9be
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/line_length_13.f90
@@ -0,0 +1,27 @@
+! { dg-do compile }
+! { dg-additional-options "-std=f2023" }
+! { dg-prune-output "some warnings being treated as errors" }
+!
+! In Fortran 2018, the linelength is    132 characters.
+! In Fortran 2023, the linelength is 10,000 characters.   <<<  Test this.
+
+implicit none
+integer :: a, b, c, d
+
+a =  & ! The next line has 9,999 characters -> OK
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 + 42
+
+b =  & ! The next line has 10,000 characters -> OK
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +  42
+
+c =  & ! The next line has 10,001 characters -> TOO LONG
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 + 4242
+
+! { dg-error "Line truncated at .1. \\\[-Werror=line-truncation\\\]" "" { target *-*-* } .-2 }
+
+d =  & ! The next line has 10,002 characters -> TOO LONG
+   1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3        +4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 +       1 +       2 +       3 +       4 +       5 +       6 +       7 +       8 +       9 +      10 + 42424
+
+! { dg-error "Line truncated at .1. \\\[-Werror=line-truncation\\\]" "" { target *-*-* } .-2 }
+
+end 
diff --git a/gcc/testsuite/gfortran.dg/line_length_2.f90 b/gcc/testsuite/gfortran.dg/line_length_2.f90
index e1ab7220d03..ff44d882257 100644
--- a/gcc/testsuite/gfortran.dg/line_length_2.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_2.f90
@@ -1,7 +1,7 @@
 ! Testcase for -ffree-line-length-none
 ! See PR fortran/21302
 ! { dg-do compile }
-! { dg-options "-ffree-line-length-none" }
+! { dg-options "-ffree-line-length-none -std=f2018" }
 program two
  if (abs(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa).gt.999.d0.or.abs(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbb).gt.999.d0.or.abs(cccccccccccccccccccc).gt.999.d0) THEN
  endif
diff --git a/gcc/testsuite/gfortran.dg/line_length_5.f90 b/gcc/testsuite/gfortran.dg/line_length_5.f90
index 81832451ea2..ba9f2850b07 100644
--- a/gcc/testsuite/gfortran.dg/line_length_5.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_5.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-Wline-truncation" }
+! { dg-options "-std=f2018 -Wline-truncation" }
 print *, 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
 end 
 ! { dg-error "Line truncated" " " { target *-*-* } 3 }
diff --git a/gcc/testsuite/gfortran.dg/line_length_6.f90 b/gcc/testsuite/gfortran.dg/line_length_6.f90
index 8cdb0209981..a88e2d247c0 100644
--- a/gcc/testsuite/gfortran.dg/line_length_6.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_6.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "" }
+! { dg-options "-std=f2018" }
 !
 ! By default, for free-form source code: Error out
 !
diff --git a/gcc/testsuite/gfortran.dg/line_length_7.f90 b/gcc/testsuite/gfortran.dg/line_length_7.f90
index b4ebf49c4bf..6c6d73b01c3 100644
--- a/gcc/testsuite/gfortran.dg/line_length_7.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_7.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-Wno-error" }
+! { dg-options "-std=f2018 -Wno-error" }
 !
 ! By default, for free-form source code: Error out
 ! But due to -Wno-error, we only expect a warning
diff --git a/gcc/testsuite/gfortran.dg/line_length_8.f90 b/gcc/testsuite/gfortran.dg/line_length_8.f90
index afd6cc2df46..822b09e803a 100644
--- a/gcc/testsuite/gfortran.dg/line_length_8.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_8.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-Wline-truncation" }
+! { dg-options "-std=f2018 -Wline-truncation" }
 !
 ! By default, for free-form source code: Error out
 ! Even with -Wline-truncation, we still get an error
diff --git a/gcc/testsuite/gfortran.dg/line_length_9.f90 b/gcc/testsuite/gfortran.dg/line_length_9.f90
index 6c156afc144..9f07d9a588e 100644
--- a/gcc/testsuite/gfortran.dg/line_length_9.f90
+++ b/gcc/testsuite/gfortran.dg/line_length_9.f90
@@ -1,5 +1,5 @@
 ! { dg-do compile }
-! { dg-options "-Wall" }
+! { dg-options "-std=f2018 -Wall" }
 !
 ! By default, for free-form source code: Error out
 ! Even with -Wall, we still get an error

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023
  2023-11-17 11:38   ` [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023 (was: [Patch] Fortran: Accept -std=f2023 support, update line-length for Fortran 2023) Tobias Burnus
@ 2023-11-17 12:06     ` Mikael Morin
  2023-11-17 19:07     ` Harald Anlauf
  2024-01-02 19:31     ` Harald Anlauf
  2 siblings, 0 replies; 9+ messages in thread
From: Mikael Morin @ 2023-11-17 12:06 UTC (permalink / raw)
  To: Tobias Burnus, Harald Anlauf, gcc-patches, fortran

Le 17/11/2023 à 12:38, Tobias Burnus a écrit :
> 
> Unless there are follow up comments, I will commit it later today.
> 
I skimmed quickly through the patch, and noticed one typo to fix:

 > diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
 > index 10387e39501..5f87b330a22 100644
 > --- a/gcc/fortran/invoke.texi
 > +++ b/gcc/fortran/invoke.texi
 > @@ -958,8 +959,8 @@ The following example will trigger the warning.
 >  @item -Wampersand
 >  Warn about missing ampersand in continued character constants. The
 >  warning is given with @option{-Wampersand}, @option{-pedantic},
 > -@option{-std=f95}, @option{-std=f2003}, @option{-std=f2008} and
 > -@option{-std=f2018}. Note: With no ampersand given in a continued
 > +@option{-std=f95}, @option{-std=f2003}, @option{-std=f2008}, 
@option{-std=f2018}
 > +and @option{-std=f203}. Note: With no ampersand given in a continued
 >  character constant, GNU Fortran assumes continuation at the first
 >  non-comment, non-whitespace character after the ampersand that
 >  initiated the continuation.

s/f203/f2023/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023
  2023-11-17 11:38   ` [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023 (was: [Patch] Fortran: Accept -std=f2023 support, update line-length for Fortran 2023) Tobias Burnus
  2023-11-17 12:06     ` [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023 Mikael Morin
@ 2023-11-17 19:07     ` Harald Anlauf
  2024-01-02 19:31     ` Harald Anlauf
  2 siblings, 0 replies; 9+ messages in thread
From: Harald Anlauf @ 2023-11-17 19:07 UTC (permalink / raw)
  To: Tobias Burnus, gcc-patches, fortran

Hi Tobias,

On 11/17/23 12:38, Tobias Burnus wrote:
> Hi Harald, hi all,
>
> On 16.11.23 20:30, Harald Anlauf wrote:
>> According to the standard one can have 999999 lines with only
>> "&" and then an ";", but then only 100 lines with 10000 characters.
>
> I believe a single '&' is not valid, you either need '&&' or something
> else + '&'; thus, you can have only half a million lines + 1.

after looking at the F2023 standard again I wonder why
they did such a disservice to compiler developers...

You are right: a single '&' is not valid.

6.3.2.4 also has:

"When used for continuation, the “&” is not part of the statement"

And 6.3.2.5 (also 6.3.3.4): "The “;” is not part of the statement".

So a million "&"-continued lines is possible in free form.

For fixed form, 6.3.3.1 has: "If a source line contains only characters
of default kind, it shall contain exactly 72 characters; otherwise, its
maximum number of characters is processor dependent."

I wonder what I should make out of this...

> In the code, I still use 1,000,000 but now with a comment.

Yeah, for the time being this is the most reasonable solution.
Let's claim that the 10^6 line limit is the new GNU standard ;-)

Cheers,
Harald


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023
  2023-11-17 11:38   ` [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023 (was: [Patch] Fortran: Accept -std=f2023 support, update line-length for Fortran 2023) Tobias Burnus
  2023-11-17 12:06     ` [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023 Mikael Morin
  2023-11-17 19:07     ` Harald Anlauf
@ 2024-01-02 19:31     ` Harald Anlauf
  2024-01-02 19:37       ` Steve Kargl
  2 siblings, 1 reply; 9+ messages in thread
From: Harald Anlauf @ 2024-01-02 19:31 UTC (permalink / raw)
  To: Tobias Burnus, gcc-patches, fortran

Dear all,

we might want to update changes.html to reflect this.  How about:

diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html
index 403feb06..9b16f5e3 100644
--- a/htdocs/gcc-14/changes.html
+++ b/htdocs/gcc-14/changes.html
@@ -284,6 +284,11 @@ a work-in-progress.</p>

  <h3 id="fortran">Fortran</h3>
  <ul>
+  <li>The compiler now accepts the <code>-std=f2023</code> option, which
+    has been added in preparation of support of Fortran 2023.  This option
+    increases the line-length limit for source in free-form to 10000, and
+    statements may have up to 1 million characters.
+  </li>
    <li> With the <code>-save-temps</code> option, preprocessed files
      with the <code>.fii</code> extension will be generated from
      free-form source files such as <code>.F90</code> and


Cheers,
Harald


Am 17.11.23 um 12:38 schrieb Tobias Burnus:
> Hi Harald, hi all,
>
> On 16.11.23 20:30, Harald Anlauf wrote:
>> On 11/16/23 14:01, Tobias Burnus wrote:
>>> This adds -std=f2023, which is mostly a prep patch for future changes.
> ...
>>> (B) In "6.3.2.6 Free form statements":
>>> Fortran 2018: "A statement shall not have more than 255 continuation
>>> lines."
>>> Fortran 2023: "A statement shall not have more than one million
>>> characters."
>>
>> this is really a funny change: we're not really prepared to handle
>> this.
>
> I can confirm this. I tried to get it working in scanner.cc but due to
> the re-parsing it is quite difficult to get it right; the main problem
> is that we keep reparsing code ("gfc_current_locus = old_loc"), such
> that a simple count will be wrong.
>
> → Now tracked at https://gcc.gnu.org/PR112586
>
>
>> According to the standard one can have 999999 lines with only
>> "&" and then an ";", but then only 100 lines with 10000 characters.
>
> I believe a single '&' is not valid, you either need '&&' or something
> else + '&'; thus, you can have only half a million lines + 1.
>
> In the code, I still use 1,000,000 but now with a comment.
>
>> There is a similar wording for fixed-form which you overlooked:
> Ups - fixed.
>> If you think that we need testcases for fixed-form, add them,
>> or forget them.  I don't bother.
> I added one.
>
>> - there are existing testcases continuation_5.f, continuation_6.f,
>>   thus I suggest to rename your new continuation_{5,6}.f90 to
>>   continuation_17.f90+ .
>
> Done. We are rather inconsistent whether we enumerate <file>.f{,90}
> together or separately; as the suffix is shown, either works.
>
>>
>> - I don't understand your new testcase line_length_14.f90 .
>>   This is supposed to test -std=gnu, but then -std=gnu is not a
>>   standard but a moving target, which is why you had to adjust
>>   existing testcases.
>>   So what does it buy us beyond line_length_1{2,3}.f90 ?
>
> Well, it ensures that the warning is not only shown for -std=f2023 but
> also for -std=f2028 and (current -std=gnu). In general, I think it is
> useful to check the lower and the upper bound.
>
> I have now removed it - as it is unlikely that we would regress on such
> changes.
>
>>> PPS: I did not bother adding .f23 as file extension; I believe that also
>>> .f18 is unsupported.
>> I never use extensions other than .f90 for portable code.
>
> Likewise  - especially as '.f95' starts out as Fortran code that
> complies to -std=f95 but slowly Fortran 2003 or later code creeps in. I
> think that's fine but then one can also directly use .f90. (Most code
> does so.)
>
> Unless there are follow up comments, I will commit it later today.
>
> Thanks for the comments!
>
> Tobias
>
> PS: I fixed the wording issue in the subject line of the email and
> header. I first wrote 'support' but that sounded a bit as if F2023 is
> supported. Hence, I wrote 'Accept' and did not remove 'support'.
> -----------------
> Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201,
> 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer:
> Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München;
> Registergericht München, HRB 106955


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023
  2024-01-02 19:31     ` Harald Anlauf
@ 2024-01-02 19:37       ` Steve Kargl
  2024-01-02 19:51         ` Harald Anlauf
  0 siblings, 1 reply; 9+ messages in thread
From: Steve Kargl @ 2024-01-02 19:37 UTC (permalink / raw)
  To: Harald Anlauf; +Cc: Tobias Burnus, gcc-patches, fortran

On Tue, Jan 02, 2024 at 08:31:15PM +0100, Harald Anlauf wrote:
> 
> we might want to update changes.html to reflect this.  How about:
> 
> diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html
> index 403feb06..9b16f5e3 100644
> --- a/htdocs/gcc-14/changes.html
> +++ b/htdocs/gcc-14/changes.html
> @@ -284,6 +284,11 @@ a work-in-progress.</p>
> 
>  <h3 id="fortran">Fortran</h3>
>  <ul>
> +  <li>The compiler now accepts the <code>-std=f2023</code> option, which
> +    has been added in preparation of support of Fortran 2023.  This option
> +    increases the line-length limit for source in free-form to 10000, and
> +    statements may have up to 1 million characters.
> +  </li>
>    <li> With the <code>-save-temps</code> option, preprocessed files
>      with the <code>.fii</code> extension will be generated from
>      free-form source files such as <code>.F90</code> and
> 

LGTM.

-- 
Steve

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023
  2024-01-02 19:37       ` Steve Kargl
@ 2024-01-02 19:51         ` Harald Anlauf
  0 siblings, 0 replies; 9+ messages in thread
From: Harald Anlauf @ 2024-01-02 19:51 UTC (permalink / raw)
  To: sgk; +Cc: Tobias Burnus, gcc-patches, fortran

Am 02.01.24 um 20:37 schrieb Steve Kargl:
> On Tue, Jan 02, 2024 at 08:31:15PM +0100, Harald Anlauf wrote:
>>
>> we might want to update changes.html to reflect this.  How about:
>>
>> diff --git a/htdocs/gcc-14/changes.html b/htdocs/gcc-14/changes.html
>> index 403feb06..9b16f5e3 100644
>> --- a/htdocs/gcc-14/changes.html
>> +++ b/htdocs/gcc-14/changes.html
>> @@ -284,6 +284,11 @@ a work-in-progress.</p>
>>
>>   <h3 id="fortran">Fortran</h3>
>>   <ul>
>> +  <li>The compiler now accepts the <code>-std=f2023</code> option, which
>> +    has been added in preparation of support of Fortran 2023.  This option
>> +    increases the line-length limit for source in free-form to 10000, and
>> +    statements may have up to 1 million characters.
>> +  </li>
>>     <li> With the <code>-save-temps</code> option, preprocessed files
>>       with the <code>.fii</code> extension will be generated from
>>       free-form source files such as <code>.F90</code> and
>>
>
> LGTM.
>

Thanks, this is now pushed.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-01-02 19:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-16 13:01 [Patch] Fortran: Accept -std=f2023 support, update line-length for Fortran 2023 Tobias Burnus
2023-11-16 19:30 ` Harald Anlauf
2023-11-17 11:38   ` [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023 (was: [Patch] Fortran: Accept -std=f2023 support, update line-length for Fortran 2023) Tobias Burnus
2023-11-17 12:06     ` [Patch] Fortran: Accept -std=f2023, update line-length for Fortran 2023 Mikael Morin
2023-11-17 19:07     ` Harald Anlauf
2024-01-02 19:31     ` Harald Anlauf
2024-01-02 19:37       ` Steve Kargl
2024-01-02 19:51         ` Harald Anlauf
2023-11-17  3:38 ` [Patch] Fortran: Accept -std=f2023 support, " Jerry D

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).