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 @@ -300,9 +300,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) { @@ -329,7 +328,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