[clang] [clang][NFC] Use range-based for loops (PR #96831)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 28 14:02:06 PDT 2024


================
@@ -2056,40 +2056,41 @@ void CXXRecordDecl::completeDefinition() {
   completeDefinition(nullptr);
 }
 
+static bool hasPureVirtualFinalOverrider(
+    const CXXRecordDecl &RD, const CXXFinalOverriderMap *FinalOverriders) {
+  auto ExistsIn = [](const CXXFinalOverriderMap &FinalOverriders) {
+    for (const CXXFinalOverriderMap::value_type &
+          OverridingMethodsEntry : FinalOverriders) {
+      for (const auto &[_, SubobjOverrides] : OverridingMethodsEntry.second) {
+        assert(SubobjOverrides.size() > 0 &&
+              "All virtual functions have overriding virtual functions");
+
+        if (SubobjOverrides.front().Method->isPureVirtual())
+          return true;
+      }
+    }
+    return false;
+  };
+
+  if (FinalOverriders)
+    return ExistsIn(*FinalOverriders);
+  CXXFinalOverriderMap MyFinalOverriders;
+  RD.getFinalOverriders(MyFinalOverriders);
+  return ExistsIn(MyFinalOverriders);
----------------
MagentaTreehouse wrote:

Done

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


More information about the cfe-commits mailing list