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

Qizhi Hu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 18 22:21:10 PDT 2023


jcsxky added a comment.

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

> A simple test should be added to StructuralEquivalenceTest.cpp too to check if ignore (and not ignore) depth works.
>
> I think this solution is not always correct, but is still an improvement.

As a friend template declaration, compared to the template class definition, the only difference is the depth of the `NonTypeTemplateParam`. If the template class definition is equivalent to the class in `From` context, there is no probelm. Otherwise, the friend template declaration is also can't equivalent  to it. Because the friend template declaration is equivalent to its definition when ignore the depth. To make a counterexample, we should put the friend declaration in different depth, but they are all equivalent in these cases.


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