teemperor added a comment.

Having the comparison code would be nice. The custom types in the associated 
types aren't compared by the generic code, so an overload like this in the 
`StmtComparer` class should be enough:

  bool IsStmtEquivalent(const GenericSelectionExpr *E1, const 
GenericSelectionExpr *E2) {
    for (auto Pair : zip_longest(E1->getAssocTypeSourceInfos(),
                                 E2->getAssocTypeSourceInfos())) {
      Optional<TypeSourceInfo *> Child1 = std::get<0>(Pair);
      Optional<TypeSourceInfo *> Child2 = std::get<1>(Pair);
      // Different number of associated types.
      if (!Child1 || !Child2)
        return false;
  
      if (!IsStructurallyEquivalent(Context, (*Child1)->getType(),
                                    (*Child2)->getType()))
        return false;
    }
    return true;
  }


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92600/new/

https://reviews.llvm.org/D92600

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to