[clang] [clang][NFC] Use range-based for loop and algorithms in `SemaDeclCXX.cpp` (PR #169938)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 1 05:25:51 PST 2025
================
@@ -13476,23 +13458,22 @@ bool Sema::CheckUsingDeclRedeclaration(SourceLocation UsingLoc,
}
NestedNameSpecifier CNNS = Qual.getCanonical();
- for (LookupResult::iterator I = Prev.begin(), E = Prev.end(); I != E; ++I) {
- NamedDecl *D = *I;
-
+ for (const NamedDecl *D : Prev) {
bool DTypename;
NestedNameSpecifier DQual = std::nullopt;
- if (UsingDecl *UD = dyn_cast<UsingDecl>(D)) {
+ if (const UsingDecl *UD = dyn_cast<UsingDecl>(D)) {
----------------
tbaederr wrote:
```suggestion
if (const auto *UD = dyn_cast<UsingDecl>(D)) {
```
https://github.com/llvm/llvm-project/pull/169938
More information about the cfe-commits
mailing list