================
@@ -2016,17 +2016,17 @@ void 
ASTDeclWriter::VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D) {
   // For an expanded parameter pack, record the number of expansion types here
   // so that it's easier for deserialization to allocate the right amount of
   // memory.
-  Expr *TypeConstraint = D->getPlaceholderTypeConstraint();
----------------
alejandro-alvarez-sonarsource wrote:

There is a difference: `D->hasPlaceholderTypeConstraint()` may be true, but 
`D->getPlaceholderTypeConstraint` may return `nullptr`.
IIUC, before this patch there was a underlying assumption that the former is 
true if and only if the latter is not `nullptr`.

This is not aligned when there are parsing errors.

See [my comment 
here](https://github.com/llvm/llvm-project/pull/121768#discussion_r1908541893).

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

Reply via email to