File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed
Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -68,11 +68,20 @@ class OmpWorkshareBlockChecker {
6868 if (const auto *e{GetExpr (context_, expr)}) {
6969 for (const Symbol &symbol : evaluate::CollectSymbols (*e)) {
7070 const Symbol &root{GetAssociationRoot (symbol)};
71- if (IsFunction (root) && !IsElementalProcedure (root)) {
72- context_.Say (expr.source ,
73- " User defined non-ELEMENTAL function "
74- " '%s' is not allowed in a WORKSHARE construct" _err_en_US,
75- root.name ());
71+ if (IsFunction (root)) {
72+ std::string attrs = " " ;
73+ if (!IsElementalProcedure (root)) {
74+ attrs = " non-ELEMENTAL" ;
75+ }
76+ if (symbol.attrs ().test (Attr::IMPURE)) {
77+ attrs = " IMPURE" + attrs;
78+ }
79+ if (attrs != " " ) {
80+ context_.Say (expr.source ,
81+ " User defined%s function '%s' is not allowed in a "
82+ " WORKSHARE construct" _err_en_US,
83+ attrs, root.name ());
84+ }
7685 }
7786 }
7887 }
You can’t perform that action at this time.
0 commit comments