[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
Tue Dec 2 08:29:09 PST 2025


================
@@ -17969,13 +17949,9 @@ DeclResult Sema::ActOnTemplatedFriendTag(
 
   if (Invalid) return true;
 
-  bool isAllExplicitSpecializations = true;
-  for (unsigned I = TempParamLists.size(); I-- > 0; ) {
-    if (TempParamLists[I]->size()) {
-      isAllExplicitSpecializations = false;
-      break;
-    }
-  }
+  const bool isAllExplicitSpecializations = std::all_of(
----------------
tbaederr wrote:

Becaus we don't make local variables const unless they are pointers or references.

https://github.com/llvm/llvm-project/pull/169938


More information about the cfe-commits mailing list