@@ -2765,9 +2765,9 @@ void OmpStructureChecker::Enter(const parser::OmpClause &x) {
2765
2765
if (const parser::OmpObjectList *objList{GetOmpObjectList (x)}) {
2766
2766
SymbolSourceMap symbols;
2767
2767
GetSymbolsInObjectList (*objList, symbols);
2768
- for (const auto &[sym , source] : symbols) {
2769
- if (!IsVariableListItem (*sym )) {
2770
- deferredNonVariables_.insert ({sym , source});
2768
+ for (const auto &[symbol , source] : symbols) {
2769
+ if (!IsVariableListItem (*symbol )) {
2770
+ deferredNonVariables_.insert ({symbol , source});
2771
2771
}
2772
2772
}
2773
2773
}
@@ -3878,9 +3878,7 @@ void OmpStructureChecker::CheckDoacross(const parser::OmpDoacross &doa) {
3878
3878
void OmpStructureChecker::CheckCopyingPolymorphicAllocatable (
3879
3879
SymbolSourceMap &symbols, const llvm::omp::Clause clause) {
3880
3880
if (context_.ShouldWarn (common::UsageWarning::Portability)) {
3881
- for (auto it{symbols.begin ()}; it != symbols.end (); ++it) {
3882
- const auto *symbol{it->first };
3883
- const auto source{it->second };
3881
+ for (auto &[symbol, source] : symbols) {
3884
3882
if (IsPolymorphicAllocatable (*symbol)) {
3885
3883
context_.Warn (common::UsageWarning::Portability, source,
3886
3884
" If a polymorphic variable with allocatable attribute '%s' is in %s clause, the behavior is unspecified" _port_en_US,
@@ -4121,10 +4119,10 @@ void OmpStructureChecker::Enter(const parser::OmpClause::Enter &x) {
4121
4119
const parser::OmpObjectList &objList{x.v };
4122
4120
SymbolSourceMap symbols;
4123
4121
GetSymbolsInObjectList (objList, symbols);
4124
- for (const auto &[sym , source] : symbols) {
4125
- if (!IsExtendedListItem (*sym )) {
4126
- context_.SayWithDecl (*sym , source,
4127
- " '%s' must be a variable or a procedure" _err_en_US, sym ->name ());
4122
+ for (const auto &[symbol , source] : symbols) {
4123
+ if (!IsExtendedListItem (*symbol )) {
4124
+ context_.SayWithDecl (*symbol , source,
4125
+ " '%s' must be a variable or a procedure" _err_en_US, symbol ->name ());
4128
4126
}
4129
4127
}
4130
4128
}
@@ -4146,10 +4144,10 @@ void OmpStructureChecker::Enter(const parser::OmpClause::From &x) {
4146
4144
const auto &objList{std::get<parser::OmpObjectList>(x.v .t )};
4147
4145
SymbolSourceMap symbols;
4148
4146
GetSymbolsInObjectList (objList, symbols);
4149
- for (const auto &[sym , source] : symbols) {
4150
- if (!IsVariableListItem (*sym )) {
4147
+ for (const auto &[symbol , source] : symbols) {
4148
+ if (!IsVariableListItem (*symbol )) {
4151
4149
context_.SayWithDecl (
4152
- *sym , source, " '%s' must be a variable" _err_en_US, sym ->name ());
4150
+ *symbol , source, " '%s' must be a variable" _err_en_US, symbol ->name ());
4153
4151
}
4154
4152
}
4155
4153
@@ -4191,10 +4189,10 @@ void OmpStructureChecker::Enter(const parser::OmpClause::To &x) {
4191
4189
const auto &objList{std::get<parser::OmpObjectList>(x.v .t )};
4192
4190
SymbolSourceMap symbols;
4193
4191
GetSymbolsInObjectList (objList, symbols);
4194
- for (const auto &[sym , source] : symbols) {
4195
- if (!IsVariableListItem (*sym )) {
4192
+ for (const auto &[symbol , source] : symbols) {
4193
+ if (!IsVariableListItem (*symbol )) {
4196
4194
context_.SayWithDecl (
4197
- *sym , source, " '%s' must be a variable" _err_en_US, sym ->name ());
4195
+ *symbol , source, " '%s' must be a variable" _err_en_US, symbol ->name ());
4198
4196
}
4199
4197
}
4200
4198
@@ -4291,9 +4289,7 @@ void OmpStructureChecker::CheckIntentInPointer(
4291
4289
const parser::OmpObjectList &objectList, const llvm::omp::Clause clause) {
4292
4290
SymbolSourceMap symbols;
4293
4291
GetSymbolsInObjectList (objectList, symbols);
4294
- for (auto it{symbols.begin ()}; it != symbols.end (); ++it) {
4295
- const auto *symbol{it->first };
4296
- const auto source{it->second };
4292
+ for (auto &[symbol, source] : symbols) {
4297
4293
if (IsPointer (*symbol) && IsIntentIn (*symbol)) {
4298
4294
context_.Say (source,
4299
4295
" Pointer '%s' with the INTENT(IN) attribute may not appear "
@@ -4324,9 +4320,7 @@ void OmpStructureChecker::GetSymbolsInObjectList(
4324
4320
4325
4321
void OmpStructureChecker::CheckDefinableObjects (
4326
4322
SymbolSourceMap &symbols, const llvm::omp::Clause clause) {
4327
- for (auto it{symbols.begin ()}; it != symbols.end (); ++it) {
4328
- const auto *symbol{it->first };
4329
- const auto source{it->second };
4323
+ for (auto &[symbol, source] : symbols) {
4330
4324
if (auto msg{WhyNotDefinable (source, context_.FindScope (source),
4331
4325
DefinabilityFlags{}, *symbol)}) {
4332
4326
context_
@@ -4358,9 +4352,7 @@ void OmpStructureChecker::CheckPrivateSymbolsInOuterCxt(
4358
4352
}
4359
4353
4360
4354
// Check if the symbols in current context are private in outer context
4361
- for (auto iter{currSymbols.begin ()}; iter != currSymbols.end (); ++iter) {
4362
- const auto *symbol{iter->first };
4363
- const auto source{iter->second };
4355
+ for (auto &[symbol, source] : currSymbols) {
4364
4356
if (enclosingSymbols.find (symbol) != enclosingSymbols.end ()) {
4365
4357
context_.Say (source,
4366
4358
" %s variable '%s' is PRIVATE in outer context" _err_en_US,
0 commit comments