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(
3089
3089
}
3090
3090
}
3091
3091
if (type->IsAssumedType ()) { // ok
3092
- } else if (IsAssumedLengthCharacter (symbol)) {
3092
+ } else if (IsAssumedLengthCharacter (symbol) &&
3093
+ !IsAllocatableOrPointer (symbol)) {
3093
3094
} else if (IsAllocatableOrPointer (symbol) &&
3094
3095
type->category () == DeclTypeSpec::Character &&
3095
3096
type->characterTypeSpec ().length ().isDeferred ()) {
3096
3097
// ok; F'2023 18.3.7 p2(6)
3097
3098
} else if (derived) { // type has been checked
3098
3099
} 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 )) {
3102
3103
// F'2023 18.3.7 p2(4,5)
3103
3104
// N.B. Language features are not passed to IsInteroperableIntrinsicType
3104
3105
// 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
95
95
real :: x(0 )
96
96
end type
97
97
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
98
107
end
You can’t perform that action at this time.
0 commit comments