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) {
2703
2703
// TemplateParmPosition.
2704
2704
D->setDepth (Record.readInt ());
2705
2705
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
+ }
2708
2710
if (D->isExpandedParameterPack ()) {
2709
2711
auto TypesAndInfos =
2710
2712
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) {
1993
1993
// TemplateParmPosition.
1994
1994
Record.push_back (D->getDepth ());
1995
1995
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
+ }
2001
2004
2002
2005
if (D->isExpandedParameterPack ()) {
2003
2006
for (unsigned I = 0 , N = D->getNumExpansionTypes (); I != N; ++I) {
You can’t perform that action at this time.
0 commit comments