File tree Expand file tree Collapse file tree 1 file changed +17
-5
lines changed
Expand file tree Collapse file tree 1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -68,11 +68,23 @@ 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+ if (attrs != " " ) {
78+ attrs = " ," + attrs;
79+ }
80+ attrs = " IMPURE" + attrs;
81+ }
82+ if (attrs != " " ) {
83+ context_.Say (expr.source ,
84+ " User defined%s function '%s' is not allowed in a "
85+ " WORKSHARE construct" _err_en_US,
86+ attrs, root.name ());
87+ }
7688 }
7789 }
7890 }
You can’t perform that action at this time.
0 commit comments