[flang-commits] [PATCH] D102653: [flang] Accept OPEN(ACCESS='APPEND') legacy extension even without warnings enabled

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon May 17 14:11:23 PDT 2021


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

My earlier patch to accept ACCESS='APPEND' only worked when warnings
were enabled; fix it.


https://reviews.llvm.org/D102653

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
@@ -833,10 +833,12 @@
   };
   auto upper{parser::ToUpperCaseLetters(value)};
   if (specValues.at(specKind).count(upper) == 0) {
-    if (specKind == IoSpecKind::Access && upper == "APPEND" &&
-        context_.languageFeatures().ShouldWarn(
-            common::LanguageFeature::OpenAccessAppend)) {
-      context_.Say(source, "ACCESS='%s' interpreted as POSITION='%s'"_en_US, value, upper);
+    if (specKind == IoSpecKind::Access && upper == "APPEND") {
+      if (context_.languageFeatures().ShouldWarn(
+              common::LanguageFeature::OpenAccessAppend)) {
+        context_.Say(source, "ACCESS='%s' interpreted as POSITION='%s'"_en_US,
+            value, upper);
+      }
     } else {
       context_.Say(source, "Invalid %s value '%s'"_err_en_US,
           parser::ToUpperCaseLetters(common::EnumToString(specKind)), value);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D102653.345994.patch
Type: text/x-patch
Size: 1026 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20210517/70482e13/attachment.bin>


More information about the flang-commits mailing list