[flang-commits] [flang] [flang][NFC] Document an extension (PR #71609)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Tue Nov 7 16:18:51 PST 2023


https://github.com/klausler created https://github.com/llvm/llvm-project/pull/71609

Fortran free form line continuation with '&' works with this compiler even across the end of an included source file, as it does with most other Fortran compilers.  This extension should be documented.

>From 6ef389f75808e1bd86b606272d26c782cf110988 Mon Sep 17 00:00:00 2001
From: Peter Klausler <pklausler at nvidia.com>
Date: Tue, 7 Nov 2023 16:15:50 -0800
Subject: [PATCH] [flang][NFC] Document an extension

Fortran free form line continuation with '&' works with this compiler
even across the end of an included source file, as it does with most
other Fortran compilers.  This extension should be documented.
---
 flang/docs/Extensions.md | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/flang/docs/Extensions.md b/flang/docs/Extensions.md
index 1aa0e03253455eb..38e5610f4af7c69 100644
--- a/flang/docs/Extensions.md
+++ b/flang/docs/Extensions.md
@@ -290,7 +290,7 @@ end
   it's an error only if the resolution is ambiguous.
 * An entity may appear in a `DATA` statement before its explicit
   type declaration under `IMPLICIT NONE(TYPE)`.
-* INCLUDE lines can start in any column, can be preceded in
+* `INCLUDE` lines can start in any column, can be preceded in
   fixed form source by a '0' in column 6, can contain spaces
   between the letters of the word INCLUDE, and can have a
   numeric character literal kind prefix on the file name.
@@ -305,6 +305,9 @@ end
   compilers.
 * A `NULL()` pointer is treated as an unallocated allocatable
   when associated with an `INTENT(IN)` allocatable dummy argument.
+* When a file included via an `INCLUDE` line or `#include` directive
+  has a continuation marker at the end of its last line in free form,
+  Fortran line continuation works.
 
 ### Extensions supported when enabled by options
 
@@ -432,7 +435,7 @@ end
   This is especially desirable when two generics of the same
   name are combined due to USE association and the mixture may
   be inadvertent.
-* Since Fortran 90, INCLUDE lines have been allowed to have
+* Since Fortran 90, `INCLUDE` lines have been allowed to have
   a numeric kind parameter prefix on the file name.  No other
   Fortran compiler supports them that I can find.
 * A `SEQUENCE` derived type is required (F'2023 C745) to have



More information about the flang-commits mailing list