[Flang][OpenMP] Use the ultimate symbol in a call to the IsPointer function
The IsPointer check currently fails for host-associated symbols in OpenMP
regions. This causes some failures in semantic checks for pointer association
in an OpenMP region. Fix is to use the ultimate symbol in the call to the
IsPointer function in CheckPointerAssignment function in
lib/Semantics/pointer-assignment.cpp.
Reviewed By: klausler, peixin
Differential Revision: https://reviews.llvm.org/D112876
diff --git a/flang/lib/Semantics/pointer-assignment.cpp b/flang/lib/Semantics/pointer-assignment.cpp
index 7003242..0fe8643 100644
--- a/flang/lib/Semantics/pointer-assignment.cpp
+++ b/flang/lib/Semantics/pointer-assignment.cpp
@@ -383,7 +383,7 @@
if (!pointer) {
return false; // error was reported
}
- if (!IsPointer(*pointer)) {
+ if (!IsPointer(pointer->GetUltimate())) {
evaluate::SayWithDeclaration(context.messages(), *pointer,
"'%s' is not a pointer"_err_en_US, pointer->name());
return false;