Skip to content

Commit 256a11e

Browse files
committed
Allow passing derived types
1 parent ec0dfc8 commit 256a11e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

flang/lib/Semantics/check-call.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ namespace Fortran::semantics {
3131
// - 1-element arrays being single member of COMMON
3232
// - avy variable from module except
3333
// - having attribute PARAMETER or PRIVATE
34+
// - having DERIVED type
3435
// - being arrays having 1-D rank and is not having ALLOCATABLE or POINTER or
3536
// VOLATILE attributes
3637
static void CheckPassGlobalVariable(
@@ -74,6 +75,10 @@ static void CheckPassGlobalVariable(
7475
if (actualFirstSymbol->attrs().test(Attr::PARAMETER) ||
7576
actualFirstSymbol->attrs().test(Attr::PRIVATE)) {
7677
warn |= false;
78+
} else if (auto type{characteristics::TypeAndShape::Characterize(
79+
actualFirstSymbol, foldingContext)};
80+
type->type().category() == TypeCategory::Derived) {
81+
warn |= false;
7782
} else if (actualFirstSymbol->Rank() != 1) {
7883
warn |= true;
7984
} else if (!actualFirstSymbol->attrs().test(Attr::ALLOCATABLE) &&

0 commit comments

Comments
 (0)