[flang] Resolve kind parameters on literal constants
authorTim Keith <tkeith@nvidia.com>
Sat, 9 Feb 2019 00:03:23 +0000 (16:03 -0800)
committerTim Keith <tkeith@nvidia.com>
Sat, 9 Feb 2019 00:03:23 +0000 (16:03 -0800)
commitd396a8845b2486ab5285e1c11c2f2f72e58bb4fe
tree830162c9379c9c6e1184fe3728eedcdcf46a95ad
parent69369e3b52f52a01d2753cd7ce4a5aba5f636fb8
[flang] Resolve kind parameters on literal constants

When the kind parameter is a constant name, that name must be resolved.

Add `CheckIntrinsicKind` and `CheckIntrinsicSize` for common checking of
valid intrinsic kinds. Previous we had different forms of the error
message depending on the context ( "unsupported INTEGER(KIND=47)" and
"INTEGER(KIND=47) is not a supported type").

Report error for parameters without initialization where are they
declared (in `Post(EntityDecl)`) rather than where they are referenced
(in `AnalyzeExpr`).

Remove error message from `AnalyzeKindParam`: `AnalyzeExpr` will report
the error (e.g. not integer, not constant, etc.).

Remove "name was not resolved" error from `AnalyzeExpr`: it should be
reported by name resolution.

Original-commit: flang-compiler/f18@9b0a99ce6696fe7db7708ea0362e103faa509968
Reviewed-on: https://github.com/flang-compiler/f18/pull/281
Tree-same-pre-rewrite: false
flang/lib/semantics/expression.cc
flang/lib/semantics/expression.h
flang/lib/semantics/resolve-names.cc
flang/test/semantics/CMakeLists.txt
flang/test/semantics/modfile20.f90 [new file with mode: 0644]
flang/test/semantics/resolve35.f90
flang/test/semantics/resolve41.f90 [new file with mode: 0644]