This revision was automatically updated to reflect the committed changes. Closed by commit rGcf236a037fd8: [NFC][CLANG] Fix nullptr dereference issue in… (authored by Manna).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151529/new/ https://reviews.llvm.org/D151529 Files: clang/lib/Sema/SemaTemplateDeduction.cpp Index: clang/lib/Sema/SemaTemplateDeduction.cpp =================================================================== --- clang/lib/Sema/SemaTemplateDeduction.cpp +++ clang/lib/Sema/SemaTemplateDeduction.cpp @@ -1703,10 +1703,12 @@ if (!IAA) return Sema::TDK_NonDeducedMismatch; + const auto *IAP = S.Context.getAsIncompleteArrayType(P); + assert(IAP && "Template parameter not of incomplete array type"); + return DeduceTemplateArgumentsByTypeMatch( - S, TemplateParams, - S.Context.getAsIncompleteArrayType(P)->getElementType(), - IAA->getElementType(), Info, Deduced, TDF & TDF_IgnoreQualifiers); + S, TemplateParams, IAP->getElementType(), IAA->getElementType(), Info, + Deduced, TDF & TDF_IgnoreQualifiers); } // T [integer-constant]
Index: clang/lib/Sema/SemaTemplateDeduction.cpp =================================================================== --- clang/lib/Sema/SemaTemplateDeduction.cpp +++ clang/lib/Sema/SemaTemplateDeduction.cpp @@ -1703,10 +1703,12 @@ if (!IAA) return Sema::TDK_NonDeducedMismatch; + const auto *IAP = S.Context.getAsIncompleteArrayType(P); + assert(IAP && "Template parameter not of incomplete array type"); + return DeduceTemplateArgumentsByTypeMatch( - S, TemplateParams, - S.Context.getAsIncompleteArrayType(P)->getElementType(), - IAA->getElementType(), Info, Deduced, TDF & TDF_IgnoreQualifiers); + S, TemplateParams, IAP->getElementType(), IAA->getElementType(), Info, + Deduced, TDF & TDF_IgnoreQualifiers); } // T [integer-constant]
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits