File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -2703,8 +2703,10 @@ void ASTDeclReader::VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D) {
27032703 // TemplateParmPosition.
27042704 D->setDepth (Record.readInt ());
27052705 D->setPosition (Record.readInt ());
2706- if (Record.readBool ()) // PlaceholderTypeConstraintInitialized
2707- D->setPlaceholderTypeConstraint (Record.readExpr ());
2706+ if (D->hasPlaceholderTypeConstraint ()) {
2707+ if (Record.readBool ()) // PlaceholderTypeConstraintInitialized
2708+ D->setPlaceholderTypeConstraint (Record.readExpr ());
2709+ }
27082710 if (D->isExpandedParameterPack ()) {
27092711 auto TypesAndInfos =
27102712 D->getTrailingObjects <std::pair<QualType, TypeSourceInfo *>>();
Original file line number Diff line number Diff line change @@ -1993,11 +1993,14 @@ void ASTDeclWriter::VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D) {
19931993 // TemplateParmPosition.
19941994 Record.push_back (D->getDepth ());
19951995 Record.push_back (D->getPosition ());
1996- Expr *TypeConstraint = D->getPlaceholderTypeConstraint ();
1997- Record.push_back (/* PlaceholderTypeConstraintInitialized=*/ TypeConstraint !=
1998- nullptr );
1999- if (TypeConstraint)
2000- Record.AddStmt (TypeConstraint);
1996+
1997+ if (D->hasPlaceholderTypeConstraint ()) {
1998+ Expr *TypeConstraint = D->getPlaceholderTypeConstraint ();
1999+ Record.push_back (/* PlaceholderTypeConstraintInitialized=*/ TypeConstraint !=
2000+ nullptr );
2001+ if (TypeConstraint)
2002+ Record.AddStmt (TypeConstraint);
2003+ }
20012004
20022005 if (D->isExpandedParameterPack ()) {
20032006 for (unsigned I = 0 , N = D->getNumExpansionTypes (); I != N; ++I) {
You can’t perform that action at this time.
0 commit comments