[flang] Enforce C1529 as a warning, C919 as an error
authorPeter Klausler <pklausler@nvidia.com>
Sat, 17 Dec 2022 15:33:04 +0000 (07:33 -0800)
committerPeter Klausler <pklausler@nvidia.com>
Sat, 17 Dec 2022 17:10:56 +0000 (09:10 -0800)
commit98eb7d0a8d0b2fe79b997a3bd5eda9721399b8bc
treea06f8fb32e077ab700c4b7eef92a9b0e1706bb7e
parent4e74f2d8a6aff089328e4b06e30d45cb0000b31f
[flang] Enforce C1529 as a warning, C919 as an error

Constraint C1529 requires that the base object of a type-bound procedure
reference be a scalar if the TBP has the NOPASS attribute.  Most
compilers do not enforce this constraint and it does not appear to
have any implementation justification, so emit portability warning.

On the other hand, we fail to enforce C919 for references to
procedure pointer components, whose base objects must of course
be scalars in order to avoid ambiguity and empty arrays, whether
NOPASS is present or not.

Differential Revision: https://reviews.llvm.org/D140148
flang/docs/Extensions.md
flang/lib/Semantics/expression.cpp
flang/test/Semantics/bindings01.f90