[PATCH] D84504: [flang]Verify C7107, C7108, C7109 from - Clause 7 constraint checks for f18.

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 24 07:18:53 PDT 2020


PeteSteinfeld requested changes to this revision.
PeteSteinfeld added a comment.
This revision now requires changes to proceed.

Thanks for working on this!

Please update the messages and the test results.  Also, please add a reference to C7109 in the source code where that constraint is enforced.



================
Comment at: flang/test/Semantics/boz-literal-constants.f90:35
+  data f / Z"AA" / ! OK
+  ! ERROR: BOZ literal should appear in a DATA statement only as a value for an integer object, but 'rescmplx' is 'COMPLEX(4)'"
+  data rescmplx / B"010101" /
----------------
sameeranjoshi wrote:
> Seems like this `8.6.7(11)` was missing a test.
> Current llvm-trunk flang outputs below error:
> ```
> "DATA statement value could not be converted to the type 'COMPLEX(4)' of the object 'rescmplx'"
> ```
> Is the error (with this patch) expected to be printed here(i.e is that getting ignored due to above error)?
I suspect that the error message produced in this instance changed when I committed the fix for D83917.  In that change, I give the normally typeless BOZ literal constants the type `INTEGER`.  The new error message seems OK to me, but you should update the test results.


================
Comment at: flang/test/Semantics/boz-literal-constants.f90:49
+
+  !ERROR: Typeless (BOZ) not allowed for 'i=' argument
+  dbl = DSHIFTL(B"0101",B"0101",2)
----------------
sameeranjoshi wrote:
> Is error below a more proper one?
> ```
> Typeless (BOZ) not allowed for both 'i=' & 'j=' arguments.
> ```
> 16.9.65(3)
> > J shall be of type integer or a boz-literal-constant. If both I and J are of type integer, they shall have the same kind type parameter. I and J shall not both be boz-literal-constants
> 
> restricts variables I and J when both are `boz-literal-constants`, whereas the current error with flang trunk assumes 'i' to be wrong, and which might not give proper information to the user.
> 
I would say:
```
Typeless (BOZ) not allowed for either 'i=' & 'j=' arguments.
```


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

https://reviews.llvm.org/D84504





More information about the llvm-commits mailing list