diff options
author | Krystian Stasiowski <sdkrystian@gmail.com> | 2024-09-20 12:57:40 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-20 14:57:40 -0400 |
commit | cdd71d61664b63ae57bdba9ee0d891f78ef79c07 (patch) | |
tree | a4f2053b8a8642048d114888d677ea2a63171107 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 6d66ac51a49af7ee46f1ccac45d312352d8b942e (diff) | |
download | llvm-cdd71d61664b63ae57bdba9ee0d891f78ef79c07.zip llvm-cdd71d61664b63ae57bdba9ee0d891f78ef79c07.tar.gz llvm-cdd71d61664b63ae57bdba9ee0d891f78ef79c07.tar.bz2 |
[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)
Currently, clang rejects the following explicit specialization of `f`
due to the constraints not being equivalent:
```
template<typename T>
struct A
{
template<bool B>
void f() requires B;
};
template<>
template<bool B>
void A<int>::f() requires B { }
```
This happens because, in most cases, we do not set the flag indicating
whether a `RedeclarableTemplate` is an explicit specialization of a
member of an implicitly instantiated class template specialization until
_after_ we compare constraints for equivalence. This patch addresses the
issue (and a number of other issues) by:
- storing the flag indicating whether a declaration is a member
specialization on a per declaration basis, and
- significantly refactoring `Sema::getTemplateInstantiationArgs` so we
collect the right set of template argument in all cases.
Many of our declaration matching & constraint evaluation woes can be
traced back to bugs in `Sema::getTemplateInstantiationArgs`. This
change/refactor should fix a lot of them. It also paves the way for
fixing #101330 and #105462 per my suggestion in #102267 (which I have
implemented on top of this patch but will merge in a subsequent PR).
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions