Skip to content

Commit 64d3790

Browse files
committed
Allow passing private
1 parent 4779af2 commit 64d3790

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

flang/lib/Semantics/check-call.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace Fortran::semantics {
3030
// - any variable from common blocks except
3131
// - 1-element arrays being single member of COMMON
3232
// - avy variable from module except
33-
// - having attribute PARAMETER
33+
// - having attribute PARAMETER or PRIVATE
3434
// - being arrays having 1-D rank and is not having ALLOCATABLE or POINTER or
3535
// VOLATILE attributes
3636
static void CheckPassGlobalVariable(
@@ -71,7 +71,8 @@ static void CheckPassGlobalVariable(
7171
const Scope *module{FindModuleContaining(owner)};
7272
ownerType = "MODULE";
7373
ownerName = module->GetName()->ToString();
74-
if (actualFirstSymbol->attrs().test(Attr::PARAMETER)) {
74+
if (actualFirstSymbol->attrs().test(Attr::PARAMETER) ||
75+
actualFirstSymbol->attrs().test(Attr::PRIVATE)) {
7576
warn |= false;
7677
} else if (actualFirstSymbol->Rank() != 1) {
7778
warn |= true;

0 commit comments

Comments
 (0)