diff --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp index 30eff01256c6..aa4cdb9d2701 100644 --- a/flang/lib/Semantics/check-omp-structure.cpp +++ b/flang/lib/Semantics/check-omp-structure.cpp @@ -1744,7 +1744,7 @@ void OmpStructureChecker::Enter(const parser::OpenMPFlushConstruct &x) { void OmpStructureChecker::Leave(const parser::OpenMPFlushConstruct &x) { auto &flushList{std::get>(x.v.t)}; - auto isVariableListItemOrCommonBlock{[this](const Symbol &sym) { + auto isVariableListItemOrCommonBlock{[](const Symbol &sym) { return IsVariableListItem(sym) || sym.detailsIf(); }};