[flang-commits] [PATCH] D139144: [flang] Emit portability warning for assigned FORMAT use

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Dec 1 14:08:25 PST 2022


klausler created this revision.
klausler added a reviewer: vdonaldson.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
klausler requested review of this revision.

Emit a portability warning about usage of a deprecated feature
when an I/O data transfer statement uses a scalar integer
variable as an assigned format.


https://reviews.llvm.org/D139144

Files:
  flang/lib/Semantics/check-io.cpp


Index: flang/lib/Semantics/check-io.cpp
===================================================================
--- flang/lib/Semantics/check-io.cpp
+++ flang/lib/Semantics/check-io.cpp
@@ -231,6 +231,9 @@
               if (!IsVariable(*expr)) {
                 context_.Say(format.source,
                     "Assigned format label must be a scalar variable"_err_en_US);
+              } else if (context_.ShouldWarn(common::LanguageFeature::Assign)) {
+                context_.Say(format.source,
+                    "Assigned format labels are deprecated"_port_en_US);
               }
               return;
             }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139144.479426.patch
Type: text/x-patch
Size: 627 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20221201/5d93f724/attachment-0001.bin>


More information about the flang-commits mailing list