mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-17 14:16:42 +00:00

Consolidate aspects of pointer assignment & structure constructor pointer component checking from Semantics/assignment.cpp and /expression.cpp into /pointer-assignment.cpp, and add a warning about data targets that are not definable objects but not hard errors. Specifically, a structure component pointer component data target is not allowed to be a USE-associated object in a pure context by a numbered constraint, but the right-hand side data target of a pointer assignment statement has no such constraint, and that's the new warning. Differential Revision: https://reviews.llvm.org/D146581
8 lines
288 B
Fortran
8 lines
288 B
Fortran
! RUN: %python %S/test_errors.py %s %flang_fc1
|
|
! Can't associate a pointer with a substring of a character literal
|
|
program main
|
|
character(:), pointer :: cp
|
|
!ERROR: Target associated with pointer 'cp' must be a designator or a call to a pointer-valued function
|
|
cp => "abcd"(1:4)
|
|
end
|