@@ -3044,7 +3044,7 @@ void OmpStructureChecker::CheckReductionObjects(
30443044 if (!std::holds_alternative<parser::Name>(base.u )) {
30453045 auto source{GetObjectSource (object)};
30463046 context_.Say (source ? *source : GetContext ().clauseSource ,
3047- " The base expression of an array element in %s clause must be an identifier" _err_en_US,
3047+ " The base expression of an array element or section in %s clause must be an identifier" _err_en_US,
30483048 parser::ToUpperCaseLetters (getClauseName (clauseId).str ()));
30493049 }
30503050 }
@@ -4013,11 +4013,13 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Copyin &x) {
40134013void OmpStructureChecker::CheckStructureComponent (
40144014 const parser::OmpObjectList &objects, llvm::omp::Clause clauseId) {
40154015 auto CheckComponent{[&](const parser::Designator &designator) {
4016- if (auto *desg{std::get_if<parser::DataRef>(&designator.u )}) {
4017- if (auto *comp{parser::Unwrap<parser::StructureComponent>(*desg)}) {
4018- context_.Say (comp->component .source ,
4019- " A variable that is part of another variable cannot appear on the %s clause" _err_en_US,
4020- parser::ToUpperCaseLetters (getClauseName (clauseId).str ()));
4016+ if (auto *dataRef{std::get_if<parser::DataRef>(&designator.u )}) {
4017+ if (!IsDataRefTypeParamInquiry (dataRef)) {
4018+ if (auto *comp{parser::Unwrap<parser::StructureComponent>(*dataRef)}) {
4019+ context_.Say (comp->component .source ,
4020+ " A variable that is part of another variable cannot appear on the %s clause" _err_en_US,
4021+ parser::ToUpperCaseLetters (getClauseName (clauseId).str ()));
4022+ }
40214023 }
40224024 }
40234025 }};
0 commit comments