OSDN Git Service

[flang] Constraint checks C751 to C760
authorPete Steinfeld <psteinfeld@nvidia.com>
Tue, 12 May 2020 16:53:58 +0000 (09:53 -0700)
committerPete Steinfeld <psteinfeld@nvidia.com>
Sat, 16 May 2020 01:50:14 +0000 (18:50 -0700)
commit38095549c6a12a75794595464fa9b95f5c6dcf35
tree99d5a37897b3a26222672b1958cb6d7c73430f18
parent7af0c8559b6d9426dd5e977370516d2baa4c206f
[flang] Constraint checks C751 to C760

Summary:
Many of these were already implemented, and I just annotated the tests and/or
the code.

C752 was a simple check to verify that CONTIGUOUS components are arrays with

C754 proved to be virtually identical to C750 that I implemented previously.
This caused me to remove the distinction between specification expressions for
type parameters and bounds expressions that I'd previously created.
the POINTER attribute.

I also changed the error messages to specify that errors in specification
expressions could arise from either bad derived type components or type
parameters.

In cases where we detect a type param that was not declared, I created a symbol
marked as erroneous.  That avoids subsequent semantic process for expressions
containing the symbol.  This change caused me to adjust tests resolve33.f90 and
resolve34.f90.  Also, I avoided putting out error messages for erroneous type
param symbols in `OkToAddComponent()` in resolve-names.cpp and in
`EvaluateParameters()`, type.cpp.

C756 checks that procedure components have the POINTER attribute.

Reviewers: tskeith, klausler, DavidTruby

Subscribers: llvm-commits

Tags: #llvm, #flang

Differential Revision: https://reviews.llvm.org/D79798
13 files changed:
flang/include/flang/Evaluate/check-expression.h
flang/lib/Evaluate/check-expression.cpp
flang/lib/Semantics/check-declarations.cpp
flang/lib/Semantics/resolve-names.cpp
flang/lib/Semantics/type.cpp
flang/test/Semantics/assign02.f90
flang/test/Semantics/resolve31.f90
flang/test/Semantics/resolve33.f90
flang/test/Semantics/resolve34.f90
flang/test/Semantics/resolve52.f90
flang/test/Semantics/resolve79.f90
flang/test/Semantics/resolve89.f90
flang/test/Semantics/resolve90.f90 [new file with mode: 0644]