Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flang] Downgrade error to warning #83032

Merged
merged 1 commit into from
Mar 2, 2024
Merged

[flang] Downgrade error to warning #83032

merged 1 commit into from
Mar 2, 2024

Conversation

klausler
Copy link
Contributor

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 #82210.

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 llvm#82210.
@llvmbot
Copy link
Collaborator

llvmbot commented Feb 26, 2024

@llvm/pr-subscribers-flang-semantics

Author: Peter Klausler (klausler)

Changes

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 #82210.


Full diff: https://github.com/llvm/llvm-project/pull/83032.diff

2 Files Affected:

  • (modified) flang/lib/Semantics/resolve-names.cpp (+1-1)
  • (modified) flang/test/Semantics/resolve61.f90 (+1-1)
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

Copy link
Contributor

@psteinfeld psteinfeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All builds and tests correctly and looks good.

@klausler klausler merged commit e09e956 into llvm:main Mar 2, 2024
7 checks passed
@klausler klausler deleted the bug82210 branch March 2, 2024 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flang:semantics flang Flang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Flang] Compilation error for pointer variable of cray pointer declared in derived type
3 participants