File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1516,7 +1516,9 @@ void OmpStructureChecker::CheckThreadprivateOrDeclareTargetVar(
15161516 " A variable in a %s directive cannot appear in an "
15171517 " EQUIVALENCE statement" _err_en_US,
15181518 ContextDirectiveAsFortran ());
1519- } else if (name->symbol ->test (Symbol::Flag::InNamelist)) {
1519+ } else if (name->symbol ->test (Symbol::Flag::InNamelist) &&
1520+ GetContext ().directive ==
1521+ llvm::omp::Directive::OMPD_threadprivate) {
15201522 context_.Say (name->source ,
15211523 " A variable in a %s directive cannot appear in a NAMELIST" _err_en_US,
15221524 ContextDirectiveAsFortran ());
@@ -1575,7 +1577,9 @@ void OmpStructureChecker::CheckThreadprivateOrDeclareTargetVar(
15751577 ContextDirectiveAsFortran (), obj->name (),
15761578 name.symbol ->name ());
15771579 }
1578- if (obj->test (Symbol::Flag::InNamelist)) {
1580+ if (obj->test (Symbol::Flag::InNamelist) &&
1581+ GetContext ().directive ==
1582+ llvm::omp::OMPD_threadprivate) {
15791583 context_.Say (name.source ,
15801584 " A variable in a %s directive cannot appear in a NAMELIST" _err_en_US,
15811585 ContextDirectiveAsFortran ());
You can’t perform that action at this time.
0 commit comments