[flang-commits] [flang] [flang] Downgrade error to warning (PR #83032)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Mon Feb 26 09:07:46 PST 2024


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

It's probably a bad idea to have a Cray pointer whose type is a derived type that is not a sequence type, but the feature is a nonstandard extension in the first place.  Downgrade the message to a warning.

Fixes https://github.com/llvm/llvm-project/issues/82210.

>From 6325a255b2a746963899df129408c0556fec4981 Mon Sep 17 00:00:00 2001
From: Peter Klausler <pklausler at nvidia.com>
Date: Mon, 26 Feb 2024 09:05:12 -0800
Subject: [PATCH] [flang] Downgrade error to warning

It's probably a bad idea to have a Cray pointer whose type is a
derived type that is not a sequence type, but the feature is a
nonstandard extension in the first place.  Downgrade the message
to a warning.

Fixes https://github.com/llvm/llvm-project/issues/82210.
---
 flang/lib/Semantics/resolve-names.cpp | 2 +-
 flang/test/Semantics/resolve61.f90    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/flang/lib/Semantics/resolve-names.cpp b/flang/lib/Semantics/resolve-names.cpp
index 36deab969456d0..3acb46204ec6e4 100644
--- a/flang/lib/Semantics/resolve-names.cpp
+++ b/flang/lib/Semantics/resolve-names.cpp
@@ -6027,7 +6027,7 @@ void DeclarationVisitor::Post(const parser::BasedPointer &bp) {
       if (const auto *derived{pointeeType->AsDerived()}) {
         if (!IsSequenceOrBindCType(derived)) {
           Say(pointeeName,
-              "Type of Cray pointee '%s' is a derived type that is neither SEQUENCE nor BIND(C)"_err_en_US);
+              "Type of Cray pointee '%s' is a derived type that is neither SEQUENCE nor BIND(C)"_warn_en_US);
         }
       }
     }
diff --git a/flang/test/Semantics/resolve61.f90 b/flang/test/Semantics/resolve61.f90
index d6499f07b86091..32bf9091a85651 100644
--- a/flang/test/Semantics/resolve61.f90
+++ b/flang/test/Semantics/resolve61.f90
@@ -114,7 +114,7 @@ subroutine p12
   type(t2) :: x2
   type(t3) :: x3
   pointer(a, x1)
-  !ERROR: Type of Cray pointee 'x2' is a derived type that is neither SEQUENCE nor BIND(C)
+  !WARNING: Type of Cray pointee 'x2' is a derived type that is neither SEQUENCE nor BIND(C)
   pointer(b, x2)
   pointer(c, x3)
 end



More information about the flang-commits mailing list