[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
Fri Apr 24 01:02:14 PDT 2020


anchu-rajendran added a comment.

In D78424#1999895 <https://reviews.llvm.org/D78424#1999895>, @klausler wrote:

> In D78424#1998443 <https://reviews.llvm.org/D78424#1998443>, @anchu-rajendran wrote:
>
> > In D78424#1993281 <https://reviews.llvm.org/D78424#1993281>, @kiranchandramohan wrote:
> >
> > > Thanks for addressing the comments.
> > >
> > > Also check the following.
> > >
> > >   type t1
> > >    integer, allocatable :: arr(:)
> > >   end type
> > >   type(t1) d1
> > >   data d1/t1((/0,1/))/
> > >   
> >
> >
> > The current revision does not catch this error. I dont think this case is covered under the Constraint C876 (or C877)
> >  C876 says a variable whose designator appears as a data-stmt-object shall not be an allocatable variable . This means `d1` cannot be an allocatable (and it does not say anything about the fields of `d1`). In this case, `d1` is not.
>
>
> The code is in error because the structure constructor is not a constant expression in the sense of 10.1.12.  I have a fix for this in my rework of DATA statement semantics in progress.


@klausler,  Okay, Thank you for pointing that out! I have fixed the bug with `IsConstantExpr` in my local branch which was causing C879 not to be checked properly which I shall submit for review after merging this patch.  @kiranchandramohan , I hope all the concerns are addressed so I can merge 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