================ @@ -58,10 +58,10 @@ getDerivedParameter(const ClassTemplateSpecializationDecl *CRTP, Arg.getAsType()->getAsCXXRecordDecl() == Derived; }); - return AnyOf ? CRTP->getSpecializedTemplate() - ->getTemplateParameters() - ->getParam(Idx - 1) - : nullptr; + return AnyOf && Idx > 0 ? CRTP->getSpecializedTemplate() ---------------- AaronBallman wrote:
If the range is empty, then `Idx` is not incremented, but `AnyOf` will be false. https://github.com/llvm/llvm-project/pull/118528 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits