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);
1426 VarDecl *D1, VarDecl *D2) {
1428 IdentifierInfo *Name2 = D2->getIdentifier();
1432 if (!IsStructurallyEquivalent(Context, D1->getType(), D2->getType()))
1438 if (D1->isThisDeclarationADefinition() != D2->isThisDeclarationADefinition())
1441 if (D1->getStorageClass() != D2->getStorageClass())
1444 return IsStructurallyEquivalent(Context, D1->getInit(), D2->getInit());
1458 RecordDecl *D2 = Field2->getType()->castAs<RecordType>()->getDecl();
1459 return IsStructurallyEquivalent(Context, D1, D2);
1566 CXXRecordDecl *D1, CXXRecordDecl *D2) {
1567 assert(D1->isLambda() && D2->isLambda() &&
1570 D2->getLambdaCallOperator()))
1579 RecordDecl *D1, RecordDecl *D2) {
1585 DeclContext *DC2 = D2->getDeclContext()->getNonTransparentContext();
1619 static bool NameIsStructurallyEquivalent(const TagDecl &D1, const TagDecl &D2) {
1627 return IsStructurallyEquivalent(GetName(D1), GetName(D2));
1632 RecordDecl *D1, RecordDecl *D2) {
1633 if (!NameIsStructurallyEquivalent(*D1, *D2)) {
1637 if (D1->isUnion() != D2->isUnion()) {
1639 Context.Diag2(D2->getLocation(), Context.getApplicableDiagnostic(
1641 << Context.ToCtx.getTypeDeclType(D2);
1648 if (!D1->getDeclName() && !D2->getDeclName()) {
1655 D2)) {
1665 if (!IsRecordContextStructurallyEquivalent(Context, D1, D2))
1671 const auto *Spec2 = dyn_cast<ClassTemplateSpecializationDecl>(D2);
1696 D2 = D2->getDefinition();
1697 if (!D1 || !D2)
1706 if (D1->hasExternalLexicalStorage() || D2->hasExternalLexicalStorage())
1711 if (D1->isBeingDefined() || D2->isBeingDefined())
1715 if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {
1730 Context.Diag2(D2->getLocation(),
1733 << Context.ToCtx.getTypeDeclType(D2);
1734 Context.Diag2(D2->getLocation(), diag::note_odr_number_of_bases)
1750 Context.Diag2(D2->getLocation(),
1753 << Context.ToCtx.getTypeDeclType(D2);
1765 Context.Diag2(D2->getLocation(),
1768 << Context.ToCtx.getTypeDeclType(D2);
1786 Context.Diag2(D2->getLocation(),
1791 Context.Diag2(D2->getLocation(), diag::note_odr_missing_friend);
1798 Context.Diag2(D2->getLocation(),
1811 Context.Diag2(D2->getLocation(),
1814 << Context.ToCtx.getTypeDeclType(D2);
1822 Context.Diag2(D2->getLocation(),
1825 << Context.ToCtx.getTypeDeclType(D2);
1829 Context.Diag2(D2->getLocation(), diag::note_odr_missing_base);
1836 QualType D2Type = Context.ToCtx.getTypeDeclType(D2);
1837 RecordDecl::field_iterator Field2 = D2->field_begin(),
1838 Field2End = D2->field_end();
1844 Context.Diag2(D2->getLocation(),
1847 << Context.ToCtx.getTypeDeclType(D2);
1850 Context.Diag2(D2->getLocation(), diag::note_odr_missing_field);
1861 Context.Diag2(D2->getLocation(), Context.getApplicableDiagnostic(
1863 << Context.ToCtx.getTypeDeclType(D2);
1876 EnumConstantDecl *D2) {
1878 const llvm::APSInt &ToVal = D2->getInitVal();
1886 if (!IsStructurallyEquivalent(D1->getIdentifier(), D2->getIdentifier()))
1891 D2->getInitExpr());
1896 EnumDecl *D1, EnumDecl *D2) {
1897 if (!NameIsStructurallyEquivalent(*D1, *D2)) {
1904 D2 = D2->getDefinition();
1905 if (!D1 || !D2)
1908 EnumDecl::enumerator_iterator EC2 = D2->enumerator_begin(),
1909 EC2End = D2->enumerator_end();
1915 Context.Diag2(D2->getLocation(),
1918 << Context.ToCtx.getTypeDeclType(D2);
1921 Context.Diag2(D2->getLocation(), diag::note_odr_missing_enumerator);
1931 Context.Diag2(D2->getLocation(),
1934 << Context.ToCtx.getTypeDeclType(D2);
1946 Context.Diag2(D2->getLocation(), Context.getApplicableDiagnostic(
1948 << Context.ToCtx.getTypeDeclType(D2);
1996 TemplateTypeParmDecl *D2) {
1997 if (D1->isParameterPack() != D2->isParameterPack()) {
1999 Context.Diag2(D2->getLocation(),
2002 << D2->isParameterPack();
2014 NonTypeTemplateParmDecl *D2) {
2015 if (D1->isParameterPack() != D2->isParameterPack()) {
2017 Context.Diag2(D2->getLocation(),
2020 << D2->isParameterPack();
2026 if (!Context.IgnoreTemplateParmDepth && D1->getDepth() != D2->getDepth())
2028 if (D1->getIndex() != D2->getIndex())
2031 if (!IsStructurallyEquivalent(Context, D1->getType(), D2->getType())) {
2033 Context.Diag2(D2->getLocation(),
2036 << D2->getType() << D1->getType();
2048 TemplateTemplateParmDecl *D2) {
2049 if (D1->isParameterPack() != D2->isParameterPack()) {
2051 Context.Diag2(D2->getLocation(),
2054 << D2->isParameterPack();
2063 D2->getTemplateParameters());
2067 StructuralEquivalenceContext &Ctx, TemplateDecl *D1, TemplateDecl *D2) {
2068 if (!IsStructurallyEquivalent(D1->getIdentifier(), D2->getIdentifier()))
2071 if (D1->getNameAsString() != D2->getNameAsString())
2074 D2->getTemplateParameters());
2079 ClassTemplateDecl *D2) {
2081 if (!IsTemplateDeclCommonStructurallyEquivalent(Context, D1, D2))
2086 D2->getTemplatedDecl());
2091 FunctionTemplateDecl *D2) {
2093 if (!IsTemplateDeclCommonStructurallyEquivalent(Context, D1, D2))
2098 D2->getTemplatedDecl()->getType());
2103 TypeAliasTemplateDecl *D2) {
2105 if (!IsTemplateDeclCommonStructurallyEquivalent(Context, D1, D2))
2110 D2->getTemplatedDecl());
2115 ConceptDecl *D2) {
2117 if (!IsTemplateDeclCommonStructurallyEquivalent(Context, D1, D2))
2122 D2->getConstraintExpr());
2126 FriendDecl *D1, FriendDecl *D2) {
2127 if ((D1->getFriendType() && D2->getFriendDecl()) ||
2128 (D1->getFriendDecl() && D2->getFriendType())) {
2131 if (D1->getFriendType() && D2->getFriendType())
2134 D2->getFriendType()->getType());
2135 if (D1->getFriendDecl() && D2->getFriendDecl())
2137 D2->getFriendDecl());
2142 TypedefNameDecl *D1, TypedefNameDecl *D2) {
2143 if (!IsStructurallyEquivalent(D1->getIdentifier(), D2->getIdentifier()))
2147 D2->getUnderlyingType());
2151 FunctionDecl *D1, FunctionDecl *D2) {
2152 if (!IsStructurallyEquivalent(D1->getIdentifier(), D2->getIdentifier()))
2156 if (!D2->isOverloadedOperator())
2158 if (D1->getOverloadedOperator() != D2->getOverloadedOperator())
2163 if (!IsStructurallyEquivalent(Context, D1->getType(), D2->getType()))
2170 ObjCIvarDecl *D1, ObjCIvarDecl *D2,
2172 if (D1->getAccessControl() != D2->getAccessControl())
2176 cast<FieldDecl>(D2), Owner2Type);
2180 ObjCIvarDecl *D1, ObjCIvarDecl *D2) {
2182 Context.ToCtx.getObjCInterfaceType(D2->getContainingInterface());
2183 return IsStructurallyEquivalent(Context, D1, D2, Owner2Type);
2234 ObjCCategoryDecl *D2) {
2235 if (!IsStructurallyEquivalent(D1->getIdentifier(), D2->getIdentifier()))
2239 *Intf2 = D2->getClassInterface();
2248 ObjCCategoryDecl::protocol_iterator Protocol2 = D2->protocol_begin(),
2249 Protocol2End = D2->protocol_end();
2265 ObjCCategoryDecl::ivar_iterator Ivar2 = D2->ivar_begin(),
2266 Ivar2End = D2->ivar_end();
2279 ObjCCategoryDecl::method_iterator Method2 = D2->meth_begin(),
2280 Method2End = D2->meth_end();
2297 Decl *D1, Decl *D2) {
2301 D2 = D2->getCanonicalDecl();
2302 std::pair<Decl *, Decl *> P{D1, D2};
2307 std::make_tuple(D1, D2, Context.IgnoreTemplateParmDepth)))
2311 // If yes D1 and D2 will be checked later (from DeclsToCheck),
2429 bool StructuralEquivalenceContext::IsEquivalent(Decl *D1, Decl *D2) {
2442 if (!::IsStructurallyEquivalent(*this, D1, D2))
2466 bool StructuralEquivalenceContext::CheckCommonEquivalence(Decl *D1, Decl *D2) {
2469 TemplateDecl *Template2 = D2->getDescribedTemplate();
2481 Decl *D1, Decl *D2) {
2484 if (D1->getKind() != D2->getKind())
2494 static_cast<DERIVED##Decl *>(D2));
2507 Decl *D2 = P.second;
2510 CheckCommonEquivalence(D1, D2) && CheckKindSpecificEquivalence(D1, D2);
2516 std::make_tuple(D1, D2, IgnoreTemplateParmDepth));