aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Semantics/check-omp-atomic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'flang/lib/Semantics/check-omp-atomic.cpp')
-rw-r--r--flang/lib/Semantics/check-omp-atomic.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/flang/lib/Semantics/check-omp-atomic.cpp b/flang/lib/Semantics/check-omp-atomic.cpp
index 2707921..ec03e6f 100644
--- a/flang/lib/Semantics/check-omp-atomic.cpp
+++ b/flang/lib/Semantics/check-omp-atomic.cpp
@@ -590,9 +590,11 @@ void OmpStructureChecker::CheckAtomicVariable(
CheckAtomicType(syms.back(), source, atom.AsFortran(), checkTypeOnPointer);
- if (IsAllocatable(syms.back()) && !IsArrayElement(atom)) {
- context_.Say(source, "Atomic variable %s cannot be ALLOCATABLE"_err_en_US,
- atom.AsFortran());
+ if (!IsArrayElement(atom) && !ExtractComplexPart(atom)) {
+ if (IsAllocatable(syms.back())) {
+ context_.Say(source, "Atomic variable %s cannot be ALLOCATABLE"_err_en_US,
+ atom.AsFortran());
+ }
}
}