[clang] [Clang][Sema] qualifier should be transformed (PR #94725)
Qizhi Hu via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 23 00:03:56 PDT 2024
jcsxky wrote:
> We can't go back from non-dependent into dependent.
Sorry, maybe I use the word 'transform' that makes you confused. Actually, what I did in `TransformTemplateName` is transforming a `QualifiedTemplateName` which is dependent due to its qualifier dependency and dependent `DeclContext` to a `DependentTemplateName`. Although the transformed `DependentTemplateName` is also dependent, its qualifier is independent. This make the condition https://github.com/llvm/llvm-project/blob/e7622ab4721141d9e6af6041fa7f9bbc1029e9aa/clang/lib/Sema/SemaTemplate.cpp#L4691 false which holds before this patch. This time the flow goes into https://github.com/llvm/llvm-project/blob/e7622ab4721141d9e6af6041fa7f9bbc1029e9aa/clang/lib/Sema/SemaTemplate.cpp#L4741-L4746 and do the specialization.
> Can you elaborate on that?
I just tried to create `DependentTemplateName` at https://github.com/llvm/llvm-project/blob/e7622ab4721141d9e6af6041fa7f9bbc1029e9aa/clang/lib/Sema/SemaTemplate.cpp#L297-L298 a few days ago and break several cases which contains the code related to partial specialization. But I didn't dig into the code and give up that approach.
https://github.com/llvm/llvm-project/pull/94725
More information about the cfe-commits
mailing list