[flang-commits] [flang] [flang] Enforce F'2023 C15121 (PR #94418)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Wed Jun 5 08:08:06 PDT 2024


================
@@ -243,6 +243,31 @@ void CheckHelper::Check(
   }
 }
 
+// Checks an elemental function result type parameter specification
+// expression for an unacceptable use of a dummy argument.
+class BadDummyChecker : public evaluate::AnyTraverse<BadDummyChecker, bool> {
+public:
+  using Base = evaluate::AnyTraverse<BadDummyChecker, bool>;
+  BadDummyChecker(parser::ContextualMessages &messages, const Scope &scope)
+      : Base{*this}, messages_{messages}, scope_{scope} {}
+  using Base::operator();
+  bool operator()(const evaluate::DescriptorInquiry &) {
+    return false; // shield base() of inquiry from further checking
+  }
----------------
klausler wrote:

Many of those inquiries will have been folded into constants; I'll extend this patch to cope with the remainder.  I can also exploit the fact that elemental dummy arguments must be scalars.

https://github.com/llvm/llvm-project/pull/94418


More information about the flang-commits mailing list