Commit 591cd405 authored by Simon Pilgrim's avatar Simon Pilgrim
Browse files

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.
parent 9d905e8c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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<TemplateParmDecl>(SemaRef.SubstDecl(OldParam, DC, Args));
        cast<TemplateParmDecl>(SemaRef.SubstDecl(OldParam, DC, Args));
    assert(NewParam->getDepth() == 0 && "unexpected template param depth");
    NewParam->setPosition(NewParam->getPosition() + Depth1IndexAdjustment);
    return NewParam;