[clang] [CIR] Add handling for static data members (PR #169134)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 21 16:27:37 PST 2025


================
@@ -1556,10 +1556,14 @@ void CIRGenModule::emitTopLevelDecl(Decl *decl) {
     break;
 
   case Decl::ClassTemplateSpecialization:
-  case Decl::CXXRecord:
+  case Decl::CXXRecord: {
+    CXXRecordDecl *crd = cast<CXXRecordDecl>(decl);
     assert(!cir::MissingFeatures::generateDebugInfo());
-    assert(!cir::MissingFeatures::cxxRecordStaticMembers());
+    for (auto *childDecl : crd->decls())
+      if (isa<VarDecl>(childDecl) || isa<CXXRecordDecl>(childDecl))
----------------
erichkeane wrote:

```suggestion
      if (isa<VarDecl, CXXRecordDecl>(childDecl))
```

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


More information about the cfe-commits mailing list