@@ -154,12 +154,17 @@ class SpecialBinding {
154154 RT_API_ATTRS bool IsArgDescriptor (int zeroBasedArg) const {
155155 return (isArgDescriptorSet_ >> zeroBasedArg) & 1 ;
156156 }
157- RT_API_ATTRS bool isTypeBound () const { return isTypeBound_; }
157+ RT_API_ATTRS bool IsTypeBound () const { return isTypeBound_ != 0 ; }
158158 RT_API_ATTRS bool IsArgContiguous (int zeroBasedArg) const {
159159 return (isArgContiguousSet_ >> zeroBasedArg) & 1 ;
160160 }
161- template <typename PROC> RT_API_ATTRS PROC GetProc () const {
162- return reinterpret_cast <PROC>(proc_);
161+ template <typename PROC>
162+ RT_API_ATTRS PROC GetProc (const Binding *bindings = nullptr ) const {
163+ if (bindings && isTypeBound_ > 0 ) {
164+ return reinterpret_cast <PROC>(bindings[isTypeBound_ - 1 ].proc );
165+ } else {
166+ return reinterpret_cast <PROC>(proc_);
167+ }
163168 }
164169
165170 FILE *Dump (FILE *) const ;
@@ -193,6 +198,8 @@ class SpecialBinding {
193198 // When false, the defined I/O subroutine must have been
194199 // called via a generic interface, not a generic TBP.
195200 std::uint8_t isArgDescriptorSet_{0 };
201+ // When a special binding is type-bound, this is its binding's index (plus 1,
202+ // so that 0 signifies that it's not type-bound).
196203 std::uint8_t isTypeBound_{0 };
197204 // True when a FINAL subroutine has a dummy argument that is an array that
198205 // is CONTIGUOUS or neither assumed-rank nor assumed-shape.
@@ -240,6 +247,7 @@ class DerivedType {
240247 RT_API_ATTRS bool noFinalizationNeeded () const {
241248 return noFinalizationNeeded_;
242249 }
250+ RT_API_ATTRS bool noDefinedAssignment () const { return noDefinedAssignment_; }
243251
244252 RT_API_ATTRS std::size_t LenParameters () const {
245253 return lenParameterKind ().Elements ();
@@ -322,6 +330,7 @@ class DerivedType {
322330 bool noInitializationNeeded_{false };
323331 bool noDestructionNeeded_{false };
324332 bool noFinalizationNeeded_{false };
333+ bool noDefinedAssignment_{false };
325334};
326335
327336} // namespace Fortran::runtime::typeInfo
0 commit comments