[flang-commits] [flang] [flang] To issue error message for unsupported usage of vector type. (PR #215248)
Eugene Epshteyn via flang-commits
flang-commits at lists.llvm.org
Fri Aug 14 13:07:45 PDT 2026
================
@@ -13,3 +13,99 @@ subroutine test_vector_assignment()
!ERROR: No intrinsic or user-defined ASSIGNMENT(=) matches operand types vector(integer(4)) and vector(real(4))
v1 = v2
end subroutine
+
+! Test that vector types are rejected in polymorphic contexts:
+! 1. ALLOCATE SOURCE=/MOLD= must not have a vector type expression
+! 2. RHS of intrinsic assignment must not be a vector type when LHS is polymorphic
+! (uses Fortran standard auto-allocation, no prior ALLOCATE)
+! 3. SAME_TYPE_AS / EXTENDS_TYPE_OF must not receive a vector type argument
+! (enforced via IsExtensibleType returning false for vector types)
+
+subroutine test_allocate_source()
+ vector(integer(4)) :: vi(2)
----------------
eugeneepshteyn wrote:
Suggestion: just to cover more cases, could you please add this declaration (here or anywhere it makes sense): `classof(vi) :: c`.
https://github.com/llvm/llvm-project/pull/215248
More information about the flang-commits
mailing list