================
@@ -2257,6 +2257,11 @@ void StmtProfiler::VisitSubstNonTypeTemplateParmExpr(
     const SubstNonTypeTemplateParmExpr *E) {
   // Profile exactly as the replacement expression.
   Visit(E->getReplacement());
+  if (auto *NTTP =
+          dyn_cast_if_present<NonTypeTemplateParmDecl>(E->getParameter());
----------------
zyn0217 wrote:

In `SubstNonTypeTemplateParmExpr::getParameter()` we returned a 
`NonTypeTemplateParmDecl` after a cast; so an `if_present` is unnecessary, at 
least `E->getParameter()` was presumed to return always non-null.

https://github.com/llvm/llvm-project/pull/91842
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to