[all-commits] [llvm/llvm-project] 2b795e: [flang] Check for undefined derived types

Pete Steinfeld via All-commits all-commits at lists.llvm.org
Fri Jun 4 14:34:25 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2b795ec682ff4a9afbfe4e5c102a51689b270ecc
      https://github.com/llvm/llvm-project/commit/2b795ec682ff4a9afbfe4e5c102a51689b270ecc
  Author: Peter Steinfeld <psteinfeld at nvidia.com>
  Date:   2021-06-04 (Fri, 04 Jun 2021)

  Changed paths:
    M flang/include/flang/Semantics/symbol.h
    M flang/lib/Semantics/check-declarations.cpp
    M flang/lib/Semantics/resolve-names.cpp
    M flang/lib/Semantics/type.cpp
    M flang/test/Semantics/bad-forward-type.f90

  Log Message:
  -----------
  [flang] Check for undefined derived types

It's possible to specify refer to an undefined derived type as the type of a
component of another derived type and then never define the type of the
component.  We were not detecting this situation.  To fix this, I
changed the value of isForwardReferenced_ in the symbol's
DerivedTypeDetails and checked for it when performing other derived type
checks.

I also had to record the fact that error messages were previously
emitted for the same problem in some cases so that I could avoid
duplicate messages.

I also added a test.

Differential Revision: https://reviews.llvm.org/D103714




More information about the All-commits mailing list