[clang] [Clang][Sema] Fix crash in containsUnexpandedParameterPacks (PR #182484)

Ayush Kumar Gaur via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 21 22:14:38 PST 2026


================
@@ -1215,12 +1215,13 @@ bool Sema::containsUnexpandedParameterPacks(Declarator &D) {
       break;
     case DeclaratorChunk::Function:
       for (unsigned i = 0, e = Chunk.Fun.NumParams; i != e; ++i) {
-        ParmVarDecl *Param = cast<ParmVarDecl>(Chunk.Fun.Params[i].Param);
+        auto *Param = dyn_cast_or_null<ParmVarDecl>(Chunk.Fun.Params[i].Param);
----------------
Ayush3941 wrote:

okay updated accordingly in latest commit

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


More information about the cfe-commits mailing list