Author: Simon Pilgrim Date: 2022-02-11T15:09:44Z New Revision: 5fb180704c17dc66dfc7f052abe47524fdf8811f
URL: https://github.com/llvm/llvm-project/commit/5fb180704c17dc66dfc7f052abe47524fdf8811f DIFF: https://github.com/llvm/llvm-project/commit/5fb180704c17dc66dfc7f052abe47524fdf8811f.diff LOG: [clang][sema] ActOnExplicitInstantiation - remove Prev nullptr check All paths have already dereferenced the Prev pointer Added: Modified: clang/lib/Sema/SemaTemplate.cpp Removed: ################################################################################ diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 64a0b45feb98..acaa5b294aa2 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -10116,7 +10116,7 @@ DeclResult Sema::ActOnExplicitInstantiation(Scope *S, } // Check the new variable specialization against the parsed input. - if (PrevTemplate && Prev && !Context.hasSameType(Prev->getType(), R)) { + if (PrevTemplate && !Context.hasSameType(Prev->getType(), R)) { Diag(T->getTypeLoc().getBeginLoc(), diag::err_invalid_var_template_spec_type) << 0 << PrevTemplate << R << Prev->getType(); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits