Index: flang/runtime/ISO_Fortran_binding.cpp =================================================================== --- flang/runtime/ISO_Fortran_binding.cpp +++ flang/runtime/ISO_Fortran_binding.cpp @@ -56,7 +56,7 @@ return CFI_INVALID_RANK; } if (descriptor->type < CFI_type_signed_char || - descriptor->type > CFI_type_struct) { + descriptor->type > CFI_TYPE_LAST) { return CFI_INVALID_TYPE; } if (!IsCharacterType(descriptor->type)) { @@ -228,7 +228,7 @@ if (rank > 0 && base_addr && !extents) { return CFI_INVALID_EXTENT; } - if (type < CFI_type_signed_char || type > CFI_type_struct) { + if (type < CFI_type_signed_char || type > CFI_TYPE_LAST) { return CFI_INVALID_TYPE; } if (!descriptor) { Index: flang/unittests/Evaluate/ISO-Fortran-binding.cpp =================================================================== --- flang/unittests/Evaluate/ISO-Fortran-binding.cpp +++ flang/unittests/Evaluate/ISO-Fortran-binding.cpp @@ -130,7 +130,7 @@ ++numErr; expectedRetCode = CFI_INVALID_RANK; } - if (type < 0 || type > CFI_type_struct) { + if (type < 0 || type > CFI_TYPE_LAST) { ++numErr; expectedRetCode = CFI_INVALID_TYPE; } @@ -166,7 +166,7 @@ CFI_attribute_t attrCases[]{ CFI_attribute_pointer, CFI_attribute_allocatable, CFI_attribute_other}; CFI_type_t typeCases[]{CFI_type_int, CFI_type_struct, CFI_type_double, - CFI_type_char, CFI_type_other, CFI_type_struct + 1}; + CFI_type_char, CFI_type_other, CFI_TYPE_LAST + 1}; CFI_index_t *extentCases[]{extents, nullptr}; void *baseAddrCases[]{dummyAddr, nullptr}; CFI_rank_t rankCases[]{0, 1, CFI_MAX_RANK, CFI_MAX_RANK + 1}; @@ -330,7 +330,7 @@ ++numErr; expectedRetCode = CFI_INVALID_RANK; } - if (type < 0 || type > CFI_type_struct) { + if (type < 0 || type > CFI_TYPE_LAST) { ++numErr; expectedRetCode = CFI_INVALID_TYPE; } @@ -375,7 +375,7 @@ CFI_attribute_t attrCases[]{ CFI_attribute_pointer, CFI_attribute_allocatable, CFI_attribute_other}; CFI_type_t typeCases[]{CFI_type_int, CFI_type_struct, CFI_type_double, - CFI_type_char, CFI_type_other, CFI_type_struct + 1}; + CFI_type_char, CFI_type_other, CFI_TYPE_LAST + 1}; void *baseAddrCases[]{dummyAddr, nullptr}; CFI_rank_t rankCases[]{0, 1, CFI_MAX_RANK, CFI_MAX_RANK + 1}; std::size_t lenCases[]{0, 42};