@@ -683,7 +683,7 @@ void CheckHelper::CheckObjectEntity(
683683 messages_.Say (
684684 " An INTENT(OUT) dummy argument may not be, or contain, EVENT_TYPE or LOCK_TYPE" _err_en_US);
685685 }
686- if (details. IsAssumedSize ( )) { // C834
686+ if (IsAssumedSizeArray (symbol )) { // C834
687687 if (type && type->IsPolymorphic ()) {
688688 messages_.Say (
689689 " An INTENT(OUT) assumed-size dummy argument array may not be polymorphic" _err_en_US);
@@ -1119,11 +1119,11 @@ void CheckHelper::CheckArraySpec(
11191119 bool isCUDAShared{
11201120 GetCUDADataAttr (&symbol).value_or (common::CUDADataAttr::Device) ==
11211121 common::CUDADataAttr::Shared};
1122+ bool isCrayPointee{symbol.test (Symbol::Flag::CrayPointee)};
11221123 std::optional<parser::MessageFixedText> msg;
1123- if (symbol.test (Symbol::Flag::CrayPointee) && !isExplicit &&
1124- !canBeAssumedSize) {
1125- msg = " Cray pointee '%s' must have explicit shape or"
1126- " assumed size" _err_en_US;
1124+ if (isCrayPointee && !isExplicit && !canBeAssumedSize) {
1125+ msg =
1126+ " Cray pointee '%s' must have explicit shape or assumed size" _err_en_US;
11271127 } else if (IsAllocatableOrPointer (symbol) && !canBeDeferred &&
11281128 !isAssumedRank) {
11291129 if (symbol.owner ().IsDerivedType ()) { // C745
@@ -1148,12 +1148,14 @@ void CheckHelper::CheckArraySpec(
11481148 }
11491149 } else if (canBeAssumedShape && !canBeDeferred) {
11501150 msg = " Assumed-shape array '%s' must be a dummy argument" _err_en_US;
1151- } else if (canBeAssumedSize && !canBeImplied && !isCUDAShared) { // C833
1152- msg = " Assumed-size array '%s' must be a dummy argument" _err_en_US;
11531151 } else if (isAssumedRank) { // C837
11541152 msg = " Assumed-rank array '%s' must be a dummy argument" _err_en_US;
1153+ } else if (canBeAssumedSize && !canBeImplied && !isCUDAShared &&
1154+ !isCrayPointee) { // C833
1155+ msg = " Assumed-size array '%s' must be a dummy argument" _err_en_US;
11551156 } else if (canBeImplied) {
1156- if (!IsNamedConstant (symbol) && !isCUDAShared) { // C835, C836
1157+ if (!IsNamedConstant (symbol) && !isCUDAShared &&
1158+ !isCrayPointee) { // C835, C836
11571159 msg = " Implied-shape array '%s' must be a named constant or a "
11581160 " dummy argument" _err_en_US;
11591161 }
@@ -1162,7 +1164,8 @@ void CheckHelper::CheckArraySpec(
11621164 msg = " Named constant '%s' array must have constant or"
11631165 " implied shape" _err_en_US;
11641166 }
1165- } else if (!IsAllocatableOrPointer (symbol) && !isExplicit) {
1167+ } else if (!isExplicit &&
1168+ !(IsAllocatableOrPointer (symbol) || isCrayPointee)) {
11661169 if (symbol.owner ().IsDerivedType ()) { // C749
11671170 msg = " Component array '%s' without ALLOCATABLE or POINTER attribute must"
11681171 " have explicit shape" _err_en_US;
@@ -2739,7 +2742,7 @@ void CheckHelper::CheckBindC(const Symbol &symbol) {
27392742 context_.SetError (symbol);
27402743 }
27412744 }
2742- if (const auto *object{ symbol.detailsIf <ObjectEntityDetails>()} ) {
2745+ if (symbol.has <ObjectEntityDetails>()) {
27432746 if (isExplicitBindC && !symbol.owner ().IsModule ()) {
27442747 messages_.Say (symbol.name (),
27452748 " A variable with BIND(C) attribute may only appear in the specification part of a module" _err_en_US);
@@ -2762,7 +2765,7 @@ void CheckHelper::CheckBindC(const Symbol &symbol) {
27622765 context_.SetError (symbol);
27632766 }
27642767 } else if ((isExplicitBindC || symbol.attrs ().test (Attr::VALUE)) &&
2765- !evaluate::IsExplicitShape (symbol) && !object-> IsAssumedSize ( )) {
2768+ !evaluate::IsExplicitShape (symbol) && !IsAssumedSizeArray (symbol )) {
27662769 SayWithDeclaration (symbol, symbol.name (),
27672770 " BIND(C) array must have explicit shape or be assumed-size unless a dummy argument without the VALUE attribute" _err_en_US);
27682771 context_.SetError (symbol);
0 commit comments