vsapsai added inline comments.
================ Comment at: clang/lib/Serialization/ASTReaderDecl.cpp:3346-3347 + if (auto *RD = dyn_cast<RecordDecl>(DC)) + return RD->getDefinition(); + ---------------- In D71734 we have ```lang=c++ if (auto *RD = dyn_cast<RecordDecl>(DC)) if (!RD->getASTContext().getLangOpts().CPlusPlus) return RD->getCanonicalDecl()->getDefinition(); ``` I've verified that in C++ unions are also CXXRecordDecl, so I think CPlusPlus check is not required. Locally I'm testing with ```lang=c++ if (auto *RD = dyn_cast<RecordDecl>(DC)) { assert(!RD->getASTContext().getLangOpts().CPlusPlus && "Unexpected RecordDecl in C++"); return RD->getDefinition(); } ``` to get extra reassurance. But don't think it should be in the final version. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106994/new/ https://reviews.llvm.org/D106994 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits