@@ -532,7 +532,9 @@ void ASTDeclWriter::VisitEnumDecl(EnumDecl *D) {
532
532
EnumDeclBits.addBit (D->isFixed ());
533
533
Record.push_back (EnumDeclBits);
534
534
535
- Record.push_back (D->getODRHash ());
535
+ // We only perform ODR checks for decls not in GMF.
536
+ if (!isFromExplicitGMF (D))
537
+ Record.push_back (D->getODRHash ());
536
538
537
539
if (MemberSpecializationInfo *MemberInfo = D->getMemberSpecializationInfo ()) {
538
540
Record.AddDeclRef (MemberInfo->getInstantiatedFrom ());
@@ -549,7 +551,7 @@ void ASTDeclWriter::VisitEnumDecl(EnumDecl *D) {
549
551
!D->isTopLevelDeclInObjCContainer () &&
550
552
!CXXRecordDecl::classofKind (D->getKind ()) &&
551
553
!D->getIntegerTypeSourceInfo () && !D->getMemberSpecializationInfo () &&
552
- !needsAnonymousDeclarationNumber (D) &&
554
+ !needsAnonymousDeclarationNumber (D) && ! isFromExplicitGMF (D) &&
553
555
D->getDeclName ().getNameKind () == DeclarationName::Identifier)
554
556
AbbrevToUse = Writer.getDeclEnumAbbrev ();
555
557
@@ -740,7 +742,9 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) {
740
742
if (D->isExplicitlyDefaulted ())
741
743
Record.AddSourceLocation (D->getDefaultLoc ());
742
744
743
- Record.push_back (D->getODRHash ());
745
+ // We only perform ODR checks for decls not in GMF.
746
+ if (!isFromExplicitGMF (D))
747
+ Record.push_back (D->getODRHash ());
744
748
745
749
if (D->isDefaulted () || D->isDeletedAsWritten ()) {
746
750
if (auto *FDI = D->getDefalutedOrDeletedInfo ()) {
@@ -1558,7 +1562,8 @@ void ASTDeclWriter::VisitCXXMethodDecl(CXXMethodDecl *D) {
1558
1562
D->getFirstDecl () == D->getMostRecentDecl () && !D->isInvalidDecl () &&
1559
1563
!D->hasAttrs () && !D->isTopLevelDeclInObjCContainer () &&
1560
1564
D->getDeclName ().getNameKind () == DeclarationName::Identifier &&
1561
- !D->hasExtInfo () && !D->isExplicitlyDefaulted ()) {
1565
+ !isFromExplicitGMF (D) && !D->hasExtInfo () &&
1566
+ !D->isExplicitlyDefaulted ()) {
1562
1567
if (D->getTemplatedKind () == FunctionDecl::TK_NonTemplate ||
1563
1568
D->getTemplatedKind () == FunctionDecl::TK_FunctionTemplate ||
1564
1569
D->getTemplatedKind () == FunctionDecl::TK_MemberSpecialization ||
0 commit comments