Fixes https://github.com/llvm/llvm-project/issues/161932 Added a check for non-intrinsic types in non-pointer assignments. Added bool checkTypeOnPointer = true to both CheckAtomicVariable and CheckAtomicType. All atomic assignment functions now pass !IsPointerAssignment(...) to control the check. The pointer-to-non-intrinsic check lives in CheckAtomicType, guarded by the checkTypeOnPointer flag. The check now applies uniformly to all atomic operations while properly excluding pointer assignments (=>). --------- Co-authored-by: Krish Gupta <krishgupta@Krishs-MacBook-Air.local>
9 lines
266 B
Fortran
9 lines
266 B
Fortran
! RUN: not %flang_fc1 -fopenmp -fsyntax-only %s 2>&1 | FileCheck %s
|
|
type t
|
|
end type
|
|
type(t), pointer :: a1, a2
|
|
!$omp atomic write
|
|
a1 = a2
|
|
! CHECK: error: ATOMIC operation requires an intrinsic scalar variable; 'a1' has the POINTER attribute and derived type 't'
|
|
end
|