[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-30 Thread Qizhi Hu via cfe-commits
jcsxky wrote: > So After we have formed a TemplateSpecializationType, we are done with the > NNS. We keep it around in an ElaboratedType for type sugar only, it should > not be needed to compile the program correctly anymore. > > So I think this solution violates one important aspect of our

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-30 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: So After we have formed a TemplateSpecializationType, we are done with the NNS. We keep it around in an ElaboratedType for type sugar only, it should not be needed to compile the program correctly anymore. So I think this solution violates one important

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-28 Thread Matheus Izvekov via cfe-commits
mizvekov wrote: > > The problem here is the loss of the qualification on the TemplateNames > > This patch fixes the problem, without taking any workarounds: #93433 > > It also doesn't cause any change in diagnostics in > > `clang/test/SemaTemplate/typename-specifier-3.cpp`. > > I think we

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-28 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky closed https://github.com/llvm/llvm-project/pull/93411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-27 Thread Qizhi Hu via cfe-commits
jcsxky wrote: > The problem here is the loss of the qualification on the TemplateNames > > This patch fixes the problem, without taking any workarounds: #93433 > > It also doesn't cause any change in diagnostics in > `clang/test/SemaTemplate/typename-specifier-3.cpp`. I think we should

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-26 Thread Matheus Izvekov via cfe-commits
https://github.com/mizvekov commented: The problem here is the loss of the qualification on the TemplateNames This patch fixes the problem, without taking any workarounds: https://github.com/llvm/llvm-project/pull/93433 It also doesn't cause any change in diagnostics in

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-26 Thread Younan Zhang via cfe-commits
@@ -7216,9 +7216,30 @@ TreeTransform::TransformElaboratedType(TypeLocBuilder , return QualType(); } - QualType NamedT = getDerived().TransformType(TLB, TL.getNamedTypeLoc()); - if (NamedT.isNull()) -return QualType(); + QualType NamedT; + if

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-26 Thread Younan Zhang via cfe-commits
@@ -28,16 +28,17 @@ namespace PR12884_original { typedef int arg; }; struct C { - typedef B::X x; // precxx17-warning{{missing 'typename' prior to dependent type name B::X; implicit 'typename' is a C++20 extension}} zyn0217 wrote: A

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-26 Thread Younan Zhang via cfe-commits
@@ -7216,9 +7216,30 @@ TreeTransform::TransformElaboratedType(TypeLocBuilder , return QualType(); } - QualType NamedT = getDerived().TransformType(TLB, TL.getNamedTypeLoc()); - if (NamedT.isNull()) -return QualType(); + QualType NamedT; + if

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-26 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/93411 >From f5f0b14945a70e3e4fd92d5e5cbdb428334fe2b8 Mon Sep 17 00:00:00 2001 From: Qizhi Hu <836744...@qq.com> Date: Sat, 25 May 2024 16:30:27 +0800 Subject: [PATCH 1/2] [Clang][Sema] Use correct TemplateName when

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-26 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky updated https://github.com/llvm/llvm-project/pull/93411 >From f5f0b14945a70e3e4fd92d5e5cbdb428334fe2b8 Mon Sep 17 00:00:00 2001 From: Qizhi Hu <836744...@qq.com> Date: Sat, 25 May 2024 16:30:27 +0800 Subject: [PATCH 1/2] [Clang][Sema] Use correct TemplateName when

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-26 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Qizhi Hu (jcsxky) Changes Consider the following testcase: ```cpp namespace PR12884_original { template typename T struct A { struct B { ##1 template typename U struct X {}; typedef int arg; }; struct C {

[clang] [Clang][Sema] Use correct TemplateName when transforming TemplateSpecializationType (PR #93411)

2024-05-26 Thread Qizhi Hu via cfe-commits
https://github.com/jcsxky created https://github.com/llvm/llvm-project/pull/93411 Consider the following testcase: ```cpp namespace PR12884_original { template struct A { struct B { ##1 template struct X {}; typedef int arg; }; struct C { typedef B::X x;