[flang-commits] [PATCH] D124544: [flang] Downgrade a fatal error to a warning

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Apr 27 12:38:43 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG84c6dc96accc: [flang] Downgrade a fatal error to a warning (authored by klausler).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124544/new/

https://reviews.llvm.org/D124544

Files:
  flang/lib/Semantics/check-case.cpp
  flang/test/Semantics/case01.f90


Index: flang/test/Semantics/case01.f90
===================================================================
--- flang/test/Semantics/case01.f90
+++ flang/test/Semantics/case01.f90
@@ -182,13 +182,13 @@
   integer :: j
   select case(1_1)
   case (127)
-  !ERROR: CASE value (128_4) overflows type (INTEGER(1)) of SELECT CASE expression
+  !WARN: CASE value (128_4) overflows type (INTEGER(1)) of SELECT CASE expression
   case (128)
-  !ERROR: CASE value (129_4) overflows type (INTEGER(1)) of SELECT CASE expression
-  !ERROR: CASE value (130_4) overflows type (INTEGER(1)) of SELECT CASE expression
+  !WARN: CASE value (129_4) overflows type (INTEGER(1)) of SELECT CASE expression
+  !WARN: CASE value (130_4) overflows type (INTEGER(1)) of SELECT CASE expression
   case (129:130)
-  !ERROR: CASE value (-130_4) overflows type (INTEGER(1)) of SELECT CASE expression
-  !ERROR: CASE value (-129_4) overflows type (INTEGER(1)) of SELECT CASE expression
+  !WARN: CASE value (-130_4) overflows type (INTEGER(1)) of SELECT CASE expression
+  !WARN: CASE value (-129_4) overflows type (INTEGER(1)) of SELECT CASE expression
   case (-130:-129)
   case (-128)
   !ERROR: Must be a scalar value, but is a rank-1 array
Index: flang/lib/Semantics/check-case.cpp
===================================================================
--- flang/lib/Semantics/check-case.cpp
+++ flang/lib/Semantics/check-case.cpp
@@ -94,7 +94,7 @@
               return value;
             } else {
               context_.Say(expr.source,
-                  "CASE value (%s) overflows type (%s) of SELECT CASE expression"_err_en_US,
+                  "CASE value (%s) overflows type (%s) of SELECT CASE expression"_warn_en_US,
                   folded.AsFortran(), caseExprType_.AsFortran());
               hasErrors_ = true;
               return std::nullopt;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124544.425590.patch
Type: text/x-patch
Size: 1838 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220427/5c2d2296/attachment-0001.bin>


More information about the flang-commits mailing list