[clang] [CIR] Unblock simple C++ structure support (PR #138368)

Morris Hafner via cfe-commits cfe-commits at lists.llvm.org
Sat May 3 08:52:34 PDT 2025


================
@@ -237,8 +237,11 @@ mlir::Type CIRGenTypes::convertRecordDeclType(const clang::RecordDecl *rd) {
   assert(insertResult && "isSafeToCovert() should have caught this.");
 
   // Force conversion of non-virtual base classes recursively.
-  if (isa<CXXRecordDecl>(rd)) {
-    cgm.errorNYI(rd->getSourceRange(), "CXXRecordDecl");
+  if (const auto *cxxRecordDecl = dyn_cast<CXXRecordDecl>(rd)) {
+    if (cxxRecordDecl->getNumBases() > 0) {
+      cgm.errorNYI(rd->getSourceRange(),
----------------
mmha wrote:

Implementing this would just be a recursive call here, so we could add this right now. Or did you refrain from doing this because we can't write a test for this at the moment?

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


More information about the cfe-commits mailing list