[flang] Fix bug for forward referenced type
authorPeter Steinfeld <psteinfeld@nvidia.com>
Fri, 11 Sep 2020 18:02:04 +0000 (11:02 -0700)
committerPeter Steinfeld <psteinfeld@nvidia.com>
Fri, 11 Sep 2020 18:58:53 +0000 (11:58 -0700)
commit398fcf224b8dd0968f27cdcc7e75bb0bc8ed6d09
tree1f4cd0358a3dd64eed52d58628070a7d2c95c482
parent238ae4eee05187758e42c00af237592612d585c2
[flang] Fix bug for forward referenced type

A type name in an IMPLICIT declaration that was later used in a PARAMETER
statement caused problems because the default symbol scope had not yet been
initialized.  I avoided dereferencing in the situation where the default scope
was uninitialized and added a test that triggers the problem.

Differential Revision: https://reviews.llvm.org/D87535
flang/lib/Semantics/symbol.cpp
flang/test/Semantics/bad-forward-type.f90