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

Peter Klausler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 23 11:53:44 PDT 2020


klausler added a comment.

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.


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