Lines Matching defs:D2

42 //                                      Decl *D1, Decl *D2);
52 // Decl *D2)`. So far so good, this is almost like the BFS. However, if we
101 Decl *D1, Decl *D2);
1409 VarDecl *D1, VarDecl *D2) {
1411 IdentifierInfo *Name2 = D2->getIdentifier();
1415 if (!IsStructurallyEquivalent(Context, D1->getType(), D2->getType()))
1421 if (D1->isThisDeclarationADefinition() != D2->isThisDeclarationADefinition())
1424 if (D1->getStorageClass() != D2->getStorageClass())
1427 return IsStructurallyEquivalent(Context, D1->getInit(), D2->getInit());
1441 RecordDecl *D2 = Field2->getType()->castAs<RecordType>()->getDecl();
1442 return IsStructurallyEquivalent(Context, D1, D2);
1549 CXXRecordDecl *D1, CXXRecordDecl *D2) {
1550 assert(D1->isLambda() && D2->isLambda() &&
1553 D2->getLambdaCallOperator()))
1562 RecordDecl *D1, RecordDecl *D2) {
1568 DeclContext *DC2 = D2->getDeclContext()->getNonTransparentContext();
1602 static bool NameIsStructurallyEquivalent(const TagDecl &D1, const TagDecl &D2) {
1610 return IsStructurallyEquivalent(GetName(D1), GetName(D2));
1615 RecordDecl *D1, RecordDecl *D2) {
1616 if (!NameIsStructurallyEquivalent(*D1, *D2)) {
1620 if (D1->isUnion() != D2->isUnion()) {
1622 Context.Diag2(D2->getLocation(), Context.getApplicableDiagnostic(
1624 << Context.ToCtx.getTypeDeclType(D2);
1631 if (!D1->getDeclName() && !D2->getDeclName()) {
1638 D2)) {
1648 if (!IsRecordContextStructurallyEquivalent(Context, D1, D2))
1654 const auto *Spec2 = dyn_cast<ClassTemplateSpecializationDecl>(D2);
1679 D2 = D2->getDefinition();
1680 if (!D1 || !D2)
1689 if (D1->hasExternalLexicalStorage() || D2->hasExternalLexicalStorage())
1694 if (D1->isBeingDefined() || D2->isBeingDefined())
1698 if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {
1713 Context.Diag2(D2->getLocation(),
1716 << Context.ToCtx.getTypeDeclType(D2);
1717 Context.Diag2(D2->getLocation(), diag::note_odr_number_of_bases)
1733 Context.Diag2(D2->getLocation(),
1736 << Context.ToCtx.getTypeDeclType(D2);
1748 Context.Diag2(D2->getLocation(),
1751 << Context.ToCtx.getTypeDeclType(D2);
1769 Context.Diag2(D2->getLocation(),
1774 Context.Diag2(D2->getLocation(), diag::note_odr_missing_friend);
1781 Context.Diag2(D2->getLocation(),
1794 Context.Diag2(D2->getLocation(),
1797 << Context.ToCtx.getTypeDeclType(D2);
1805 Context.Diag2(D2->getLocation(),
1808 << Context.ToCtx.getTypeDeclType(D2);
1812 Context.Diag2(D2->getLocation(), diag::note_odr_missing_base);
1819 QualType D2Type = Context.ToCtx.getTypeDeclType(D2);
1820 RecordDecl::field_iterator Field2 = D2->field_begin(),
1821 Field2End = D2->field_end();
1827 Context.Diag2(D2->getLocation(),
1830 << Context.ToCtx.getTypeDeclType(D2);
1833 Context.Diag2(D2->getLocation(), diag::note_odr_missing_field);
1844 Context.Diag2(D2->getLocation(), Context.getApplicableDiagnostic(
1846 << Context.ToCtx.getTypeDeclType(D2);
1859 EnumConstantDecl *D2) {
1861 const llvm::APSInt &ToVal = D2->getInitVal();
1869 if (!IsStructurallyEquivalent(D1->getIdentifier(), D2->getIdentifier()))
1874 D2->getInitExpr());
1879 EnumDecl *D1, EnumDecl *D2) {
1880 if (!NameIsStructurallyEquivalent(*D1, *D2)) {
1887 D2 = D2->getDefinition();
1888 if (!D1 || !D2)
1891 EnumDecl::enumerator_iterator EC2 = D2->enumerator_begin(),
1892 EC2End = D2->enumerator_end();
1898 Context.Diag2(D2->getLocation(),
1901 << Context.ToCtx.getTypeDeclType(D2);
1904 Context.Diag2(D2->getLocation(), diag::note_odr_missing_enumerator);
1914 Context.Diag2(D2->getLocation(),
1917 << Context.ToCtx.getTypeDeclType(D2);
1929 Context.Diag2(D2->getLocation(), Context.getApplicableDiagnostic(
1931 << Context.ToCtx.getTypeDeclType(D2);
1979 TemplateTypeParmDecl *D2) {
1980 if (D1->isParameterPack() != D2->isParameterPack()) {
1982 Context.Diag2(D2->getLocation(),
1985 << D2->isParameterPack();
1997 NonTypeTemplateParmDecl *D2) {
1998 if (D1->isParameterPack() != D2->isParameterPack()) {
2000 Context.Diag2(D2->getLocation(),
2003 << D2->isParameterPack();
2009 if (!Context.IgnoreTemplateParmDepth && D1->getDepth() != D2->getDepth())
2011 if (D1->getIndex() != D2->getIndex())
2014 if (!IsStructurallyEquivalent(Context, D1->getType(), D2->getType())) {
2016 Context.Diag2(D2->getLocation(),
2019 << D2->getType() << D1->getType();
2031 TemplateTemplateParmDecl *D2) {
2032 if (D1->isParameterPack() != D2->isParameterPack()) {
2034 Context.Diag2(D2->getLocation(),
2037 << D2->isParameterPack();
2046 D2->getTemplateParameters());
2050 StructuralEquivalenceContext &Ctx, TemplateDecl *D1, TemplateDecl *D2) {
2051 if (!IsStructurallyEquivalent(D1->getIdentifier(), D2->getIdentifier()))
2054 if (D1->getNameAsString() != D2->getNameAsString())
2057 D2->getTemplateParameters());
2062 ClassTemplateDecl *D2) {
2064 if (!IsTemplateDeclCommonStructurallyEquivalent(Context, D1, D2))
2069 D2->getTemplatedDecl());
2074 FunctionTemplateDecl *D2) {
2076 if (!IsTemplateDeclCommonStructurallyEquivalent(Context, D1, D2))
2081 D2->getTemplatedDecl()->getType());
2086 TypeAliasTemplateDecl *D2) {
2088 if (!IsTemplateDeclCommonStructurallyEquivalent(Context, D1, D2))
2093 D2->getTemplatedDecl());
2098 ConceptDecl *D2) {
2100 if (!IsTemplateDeclCommonStructurallyEquivalent(Context, D1, D2))
2105 D2->getConstraintExpr());
2109 FriendDecl *D1, FriendDecl *D2) {
2110 if ((D1->getFriendType() && D2->getFriendDecl()) ||
2111 (D1->getFriendDecl() && D2->getFriendType())) {
2114 if (D1->getFriendType() && D2->getFriendType())
2117 D2->getFriendType()->getType());
2118 if (D1->getFriendDecl() && D2->getFriendDecl())
2120 D2->getFriendDecl());
2125 TypedefNameDecl *D1, TypedefNameDecl *D2) {
2126 if (!IsStructurallyEquivalent(D1->getIdentifier(), D2->getIdentifier()))
2130 D2->getUnderlyingType());
2134 FunctionDecl *D1, FunctionDecl *D2) {
2135 if (!IsStructurallyEquivalent(D1->getIdentifier(), D2->getIdentifier()))
2139 if (!D2->isOverloadedOperator())
2141 if (D1->getOverloadedOperator() != D2->getOverloadedOperator())
2146 if (!IsStructurallyEquivalent(Context, D1->getType(), D2->getType()))
2153 ObjCIvarDecl *D1, ObjCIvarDecl *D2,
2155 if (D1->getAccessControl() != D2->getAccessControl())
2159 cast<FieldDecl>(D2), Owner2Type);
2163 ObjCIvarDecl *D1, ObjCIvarDecl *D2) {
2165 Context.ToCtx.getObjCInterfaceType(D2->getContainingInterface());
2166 return IsStructurallyEquivalent(Context, D1, D2, Owner2Type);
2217 ObjCCategoryDecl *D2) {
2218 if (!IsStructurallyEquivalent(D1->getIdentifier(), D2->getIdentifier()))
2222 *Intf2 = D2->getClassInterface();
2231 ObjCCategoryDecl::protocol_iterator Protocol2 = D2->protocol_begin(),
2232 Protocol2End = D2->protocol_end();
2248 ObjCCategoryDecl::ivar_iterator Ivar2 = D2->ivar_begin(),
2249 Ivar2End = D2->ivar_end();
2262 ObjCCategoryDecl::method_iterator Method2 = D2->meth_begin(),
2263 Method2End = D2->meth_end();
2280 Decl *D1, Decl *D2) {
2284 D2 = D2->getCanonicalDecl();
2285 std::pair<Decl *, Decl *> P{D1, D2};
2293 // If yes D1 and D2 will be checked later (from DeclsToCheck),
2411 bool StructuralEquivalenceContext::IsEquivalent(Decl *D1, Decl *D2) {
2424 if (!::IsStructurallyEquivalent(*this, D1, D2))
2448 bool StructuralEquivalenceContext::CheckCommonEquivalence(Decl *D1, Decl *D2) {
2451 TemplateDecl *Template2 = D2->getDescribedTemplate();
2463 Decl *D1, Decl *D2) {
2466 if (D1->getKind() != D2->getKind())
2476 static_cast<DERIVED##Decl *>(D2));
2489 Decl *D2 = P.second;
2492 CheckCommonEquivalence(D1, D2) && CheckKindSpecificEquivalence(D1, D2);