diff --git a/flang/lib/Semantics/compute-offsets.cpp b/flang/lib/Semantics/compute-offsets.cpp --- a/flang/lib/Semantics/compute-offsets.cpp +++ b/flang/lib/Semantics/compute-offsets.cpp @@ -295,9 +295,8 @@ } void ComputeOffsetsHelper::DoSymbol(Symbol &symbol) { - if (symbol.has() || symbol.has() || - symbol.has() || symbol.has()) { - return; // these have type but no size + if (!symbol.has() && !symbol.has()) { + return; } SizeAndAlignment s{GetSizeAndAlignment(symbol)}; if (s.size == 0) { @@ -324,7 +323,7 @@ auto ComputeOffsetsHelper::GetElementSize(const Symbol &symbol) -> SizeAndAlignment { const DeclTypeSpec *type{symbol.GetType()}; - if (!type) { + if (!evaluate::DynamicType::From(type).has_value()) { return {}; } // TODO: The size of procedure pointers is not yet known