[flang-commits] [flang] [flang][OpenMP] Implement `CheckReductionObjects` for all reduction c… (PR #118689)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Fri Dec 6 04:20:15 PST 2024


================
@@ -3945,29 +4010,26 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Copyin &x) {
       currSymbols, llvm::omp::Clause::OMPC_copyin);
 }
 
-void OmpStructureChecker::CheckStructureElement(
-    const parser::OmpObjectList &ompObjectList,
-    const llvm::omp::Clause clause) {
-  for (const auto &ompObject : ompObjectList.v) {
+void OmpStructureChecker::CheckStructureComponent(
+    const parser::OmpObjectList &objects, llvm::omp::Clause clauseId) {
+  auto CheckComponent{[&](const parser::Designator &designator) {
+    if (auto *desg{std::get_if<parser::DataRef>(&designator.u)}) {
+      if (auto *comp{parser::Unwrap<parser::StructureComponent>(*desg)}) {
+        context_.Say(comp->component.source,
+            "A variable that is part of another variable cannot appear on the %s clause"_err_en_US,
----------------
kiranchandramohan wrote:

Did you miss the `(structure element)` part or is it not needed?

https://github.com/llvm/llvm-project/pull/118689


More information about the flang-commits mailing list