File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2663,7 +2663,11 @@ void ASTDeclReader::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) {
26632663
26642664 D->setDeclaredWithTypename (Record.readInt ());
26652665
2666- if (D->hasTypeConstraint ()) {
2666+ bool TypeConstraintInitialized = false ;
2667+ if (D->hasTypeConstraint ())
2668+ TypeConstraintInitialized = Record.readBool ();
2669+
2670+ if (D->hasTypeConstraint () && TypeConstraintInitialized) {
26672671 ConceptReference *CR = nullptr ;
26682672 if (Record.readBool ())
26692673 CR = Record.readConceptReference ();
Original file line number Diff line number Diff line change @@ -1951,6 +1951,8 @@ void ASTDeclWriter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) {
19511951 Record.push_back (D->wasDeclaredWithTypename ());
19521952
19531953 const TypeConstraint *TC = D->getTypeConstraint ();
1954+ if (D->hasTypeConstraint ())
1955+ Record.push_back (/* TypeConstraintInitialized=*/ TC != nullptr );
19541956 if (TC) {
19551957 auto *CR = TC->getConceptReference ();
19561958 Record.push_back (CR != nullptr );
@@ -1968,7 +1970,7 @@ void ASTDeclWriter::VisitTemplateTypeParmDecl(TemplateTypeParmDecl *D) {
19681970 if (OwnsDefaultArg)
19691971 Record.AddTemplateArgumentLoc (D->getDefaultArgument ());
19701972
1971- if (!TC && !OwnsDefaultArg &&
1973+ if (!D-> hasTypeConstraint () && !OwnsDefaultArg &&
19721974 D->getDeclContext () == D->getLexicalDeclContext () &&
19731975 !D->isInvalidDecl () && !D->hasAttrs () &&
19741976 !D->isTopLevelDeclInObjCContainer () && !D->isImplicit () &&
You can’t perform that action at this time.
0 commit comments