Hi jordan_rose,

rsmith suggested using CXXRecordDecl::isEmpty() instead, as it "also checks for
virtual functions/virtual bases, and handles the case where the only fields are
zero-length bitfields"

http://llvm-reviews.chandlerc.com/D1573

Files:
  lib/StaticAnalyzer/Core/RegionStore.cpp

Index: lib/StaticAnalyzer/Core/RegionStore.cpp
===================================================================
--- lib/StaticAnalyzer/Core/RegionStore.cpp
+++ lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -1836,7 +1836,7 @@
   if (!RD->field_empty())
     return false;
   if (const CXXRecordDecl *CRD = dyn_cast<CXXRecordDecl>(RD))
-    return CRD->getNumBases() == 0;
+    return CRD->isEmpty();
   return true;
 }
Index: lib/StaticAnalyzer/Core/RegionStore.cpp
===================================================================
--- lib/StaticAnalyzer/Core/RegionStore.cpp
+++ lib/StaticAnalyzer/Core/RegionStore.cpp
@@ -1836,7 +1836,7 @@
   if (!RD->field_empty())
     return false;
   if (const CXXRecordDecl *CRD = dyn_cast<CXXRecordDecl>(RD))
-    return CRD->getNumBases() == 0;
+    return CRD->isEmpty();
   return true;
 }
 
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to