[PATCH] D78424: [flang] Added Semantic Checks for 2 Data constraints and fixed the semantic errors in 3 test cases

Anchu Rajendran S via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 14 10:16:51 PDT 2020


anchu-rajendran marked an inline comment as done.
anchu-rajendran added inline comments.


================
Comment at: flang/lib/Semantics/check-data.cpp:100
+    } else {
+      return CheckAnySymbol(symbol);
+    }
----------------
klausler wrote:
> This looks like you don't apply checks for dummy arguments, functions, blank COMMON, and so on if the designator is a component.  If so, that's wrong.  `DATA DUMMYARG%X / 1.0 /`.
@klausler ,This is implemented in line 76 in the same file . I see that, (for the examples I could think of,) when a component is used, only the first symbol needs to be checked for checks in `CheckFirstSymbol`.  Line 116 in data04.f90 covers this case and emits proper error message as the checks are done on component. similarly lines 88, 119, 140 in the same file covers other cases  
One thing that is lacking here is none of these tests are done on subscripts. However, I could not create a test case were subscript is a constant (enforced by C875) and would violate one of the other constraints.  (eg, C874 is not checked on subscripts). Can I know your opinion on this? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78424





More information about the llvm-commits mailing list