[PATCH] D156693: [clang][ASTImporter]Skip check friend template depth

Qizhi Hu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 8 05:45:54 PDT 2023


jcsxky added a comment.

In D156693#4568941 <https://reviews.llvm.org/D156693#4568941>, @balazske wrote:

> This fix can cause problems because the depth comparison is omitted all times. It would be better to omit depth check if the imported template is a friend, and has a `ClassTemplateSpecializationDecl` as context. Probably even then it is possible to construct cases where the checked template has references to other templates with different "depth" which should not omitted in the check. But I have no idea of a better solution, only to pass a `ClassTemplateDecl` or `ClassTemplateSpecializationDecl` to `StructuralEquivalenceContext` and omit the depth check only at this object.

Thanks for your advice. More conditions are added to check when to ignore the comparison and minimize the influence to other.
Also I have tried to not increase depth in friend declaration in the template class, but the code affects others a lot. Only to skip the comparison can pass this special case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D156693



More information about the cfe-commits mailing list