File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -3089,16 +3089,17 @@ parser::Messages CheckHelper::WhyNotInteroperableObject(
30893089 }
30903090 }
30913091 if (type->IsAssumedType ()) { // ok
3092- } else if (IsAssumedLengthCharacter (symbol)) {
3092+ } else if (IsAssumedLengthCharacter (symbol) &&
3093+ !IsAllocatableOrPointer (symbol)) {
30933094 } else if (IsAllocatableOrPointer (symbol) &&
30943095 type->category () == DeclTypeSpec::Character &&
30953096 type->characterTypeSpec ().length ().isDeferred ()) {
30963097 // ok; F'2023 18.3.7 p2(6)
30973098 } else if (derived) { // type has been checked
30983099 } else if (auto dyType{evaluate::DynamicType::From (*type)}; dyType &&
3099- evaluate::IsInteroperableIntrinsicType (*dyType,
3100- InModuleFile () ? nullptr : &context_.languageFeatures ())
3101- .value_or (false )) {
3100+ evaluate::IsInteroperableIntrinsicType (
3101+ *dyType, InModuleFile () ? nullptr : &context_.languageFeatures ())
3102+ .value_or (false )) {
31023103 // F'2023 18.3.7 p2(4,5)
31033104 // N.B. Language features are not passed to IsInteroperableIntrinsicType
31043105 // when processing a module file, since the module file might have been
Original file line number Diff line number Diff line change @@ -95,4 +95,13 @@ program main
9595 real :: x(0 )
9696 end type
9797
98+ interface
99+ subroutine badAssumedLen (x ,y ,z ) bind(c)
100+ ! ERROR: A BIND(C) object must have an interoperable type
101+ character (* ), pointer :: x
102+ ! ERROR: A BIND(C) object must have an interoperable type
103+ character (* ), allocatable :: y
104+ character (* ) z ! ok
105+ end
106+ end interface
98107end
You can’t perform that action at this time.
0 commit comments