From 591cd40584300a1d5d33bfaefa4698c02ef56887 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Tue, 14 Jan 2020 13:48:02 +0000 Subject: [PATCH] Fix "pointer is null" static analyzer warnings. NFCI. Use cast<> instead of cast_or_null<> since the pointers are always dereferenced and cast<> will perform the null assertion for us. --- clang/lib/Sema/SemaTemplate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 69aabcd7d634..0a3e59d55234 100755 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -1894,7 +1894,7 @@ private: // Ask the template instantiator to do the heavy lifting for us, then adjust // the index of the parameter once it's done. auto *NewParam = - cast_or_null(SemaRef.SubstDecl(OldParam, DC, Args)); + cast(SemaRef.SubstDecl(OldParam, DC, Args)); assert(NewParam->getDepth() == 0 && "unexpected template param depth"); NewParam->setPosition(NewParam->getPosition() + Depth1IndexAdjustment); return NewParam;