@@ -200,8 +200,12 @@ bool OmpStructureChecker::CheckAllowedClause(llvmOmpClause clause) {
200200 return CheckAllowed (clause);
201201}
202202
203+ bool OmpStructureChecker::IsVariableListItem (const Symbol &sym) {
204+ return evaluate::IsVariable (sym) || sym.attrs ().test (Attr::POINTER);
205+ }
206+
203207bool OmpStructureChecker::IsExtendedListItem (const Symbol &sym) {
204- return evaluate::IsVariable (sym) || sym.IsSubprogram ();
208+ return IsVariableListItem (sym) || sym.IsSubprogram ();
205209}
206210
207211bool OmpStructureChecker::IsCloselyNestedRegion (const OmpDirectiveSet &set) {
@@ -2351,7 +2355,7 @@ void OmpStructureChecker::Enter(const parser::OmpClause &x) {
23512355 SymbolSourceMap symbols;
23522356 GetSymbolsInObjectList (*objList, symbols);
23532357 for (const auto &[sym, source] : symbols) {
2354- if (!evaluate::IsVariable ( sym)) {
2358+ if (!IsVariableListItem (* sym)) {
23552359 deferredNonVariables_.insert ({sym, source});
23562360 }
23572361 }
@@ -3428,7 +3432,7 @@ void OmpStructureChecker::Enter(const parser::OmpClause::To &x) {
34283432 SymbolSourceMap symbols;
34293433 GetSymbolsInObjectList (objList, symbols);
34303434 for (const auto &[sym, source] : symbols) {
3431- if (!evaluate::IsVariable (*sym)) {
3435+ if (!IsVariableListItem (*sym)) {
34323436 context_.SayWithDecl (
34333437 *sym, source, " '%s' must be a variable" _err_en_US, sym->name ());
34343438 }
0 commit comments