[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
Wed Apr 22 04:17:07 PDT 2020


anchu-rajendran marked 2 inline comments as done.
anchu-rajendran added inline comments.


================
Comment at: flang/lib/Semantics/check-data.cpp:44
+          "Data Object must not be accessed by host association"_err_en_US);
+    } else if (IsUseAssociated(*symbol, scope)) {
+      context_.Say(name.source,
----------------
kiranchandramohan wrote:
> kiranchandramohan wrote:
> > Should this check fire for the data statement in the following program where the type is defined in a module but the variable itself is not?
> > ```
> > module dt
> >   type d
> >     real r
> >   end type
> > end module
> > program test
> >   use dt
> >   type(d) :: d1
> >   data d1%r/2.5/
> > end program
> > ```
> I wasn't sure whether using the type from the module makes the variable d1 a use associated variable. What is your conclusion?
Hi,
Thank you for pointing this out! That was a corner case which was not checked properly. I have modified the implementation and included tests for the same. 


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