Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AST] Accept identical TypeConstraint referring to other template
parameters. The current implementation to judge the similarity of TypeConstraint in ASTContext::isSameTemplateParameter is problematic, it couldn't handle the following case: ```C++ template <__integer_like _Tp, C<_Tp> Sentinel> constexpr _Tp operator()(_Tp &&__t, Sentinel &&last) const { return __t; } ``` When we see 2 such declarations from different modules, we would judge their similarity by `ASTContext::isSame*` methods. But problems come for the TypeConstraint. Originally, we would profile each argument one by one. But it is not right. Since the profiling result of `_Tp` would refer to two different template type declarations. So it would get different results. It is right since the `_Tp` in different modules refers to different declarations indeed. So the same declaration in different modules would meet incorrect our-checking results. It is not the thing we want. We want to know if the TypeConstraint have the same expression. Reviewer: vsapsai, ilya-biryukov Differential Revision: https://reviews.llvm.org/D129068
- Loading branch information
1 parent
5d41fe0
commit f6b0ae1
Showing
3 changed files
with
112 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters