[clang] [clang-tools-extra] [clangd] [AST] Handle uninitialized type constraints (PR #110496)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 30 06:49:13 PDT 2024


================
@@ -1899,7 +1899,7 @@ void ASTDeclWriter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) {
   Record.push_back(D->wasDeclaredWithTypename());
 
   const TypeConstraint *TC = D->getTypeConstraint();
-  assert((bool)TC == D->hasTypeConstraint());
+  Record.push_back(TC != nullptr); // reflects TypeConstraintInitialized
----------------
zyn0217 wrote:

nit:
`Record.push_back(/*TypeConstraintInitialized=*/TC != nullptr)`

https://github.com/llvm/llvm-project/pull/110496


More information about the cfe-commits mailing list