[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-07 Thread Haojian Wu via llvm-branch-commits
https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/90961 >From 5b70158f8eff30125c0bf0d675bab62497ac620f Mon Sep 17 00:00:00 2001 From: Haojian Wu Date: Fri, 3 May 2024 13:54:06 +0200 Subject: [PATCH 1/2] [clang] CTAD alias: refine the transformation for the require-cla

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-07 Thread Haojian Wu via llvm-branch-commits
@@ -2744,31 +2744,155 @@ bool hasDeclaredDeductionGuides(DeclarationName Name, DeclContext *DC) { return false; } +unsigned getTemplateDepth(NamedDecl *TemplateParam) { hokein wrote: Renamed to `getTemplateParameterDepth` per your suggestion. https://gith

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-07 Thread Haojian Wu via llvm-branch-commits
@@ -2744,31 +2744,155 @@ bool hasDeclaredDeductionGuides(DeclarationName Name, DeclContext *DC) { return false; } +unsigned getTemplateDepth(NamedDecl *TemplateParam) { + if (auto *TTP = dyn_cast(TemplateParam)) +return TTP->getDepth(); + if (auto *TTP = dyn_cast(Temp

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-07 Thread Haojian Wu via llvm-branch-commits
@@ -2744,31 +2744,155 @@ bool hasDeclaredDeductionGuides(DeclarationName Name, DeclContext *DC) { return false; } +unsigned getTemplateDepth(NamedDecl *TemplateParam) { hokein wrote: Done. https://github.com/llvm/llvm-project/pull/90961 __

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-07 Thread Haojian Wu via llvm-branch-commits
@@ -2744,31 +2744,155 @@ bool hasDeclaredDeductionGuides(DeclarationName Name, DeclContext *DC) { return false; } +unsigned getTemplateDepth(NamedDecl *TemplateParam) { hokein wrote: Yeah, we're in an anonymous namespace. https://github.com/llvm/llvm-proj

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-07 Thread Haojian Wu via llvm-branch-commits
@@ -2744,31 +2744,155 @@ bool hasDeclaredDeductionGuides(DeclarationName Name, DeclContext *DC) { return false; } +unsigned getTemplateDepth(NamedDecl *TemplateParam) { + if (auto *TTP = dyn_cast(TemplateParam)) +return TTP->getDepth(); + if (auto *TTP = dyn_cast(Temp

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-07 Thread Haojian Wu via llvm-branch-commits
@@ -2744,31 +2744,155 @@ bool hasDeclaredDeductionGuides(DeclarationName Name, DeclContext *DC) { return false; } +unsigned getTemplateDepth(NamedDecl *TemplateParam) { + if (auto *TTP = dyn_cast(TemplateParam)) +return TTP->getDepth(); + if (auto *TTP = dyn_cast(Temp

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-03 Thread Haojian Wu via llvm-branch-commits
https://github.com/hokein created https://github.com/llvm/llvm-project/pull/90961 In the clang AST, constraint nodes are deliberately not instantiated unless they are actively being evaluated. Consequently, occurrences of template parameters in the require-clause expression have a subtle "dept

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-03 Thread via llvm-branch-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Haojian Wu (hokein) Changes In the clang AST, constraint nodes are deliberately not instantiated unless they are actively being evaluated. Consequently, occurrences of template parameters in the require-clause expression have a subtle "de

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-03 Thread Erich Keane via llvm-branch-commits
https://github.com/erichkeane approved this pull request. I think this makes sense, 2 nits, else LGTM. https://github.com/llvm/llvm-project/pull/90961 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-03 Thread Erich Keane via llvm-branch-commits
@@ -2744,31 +2744,155 @@ bool hasDeclaredDeductionGuides(DeclarationName Name, DeclContext *DC) { return false; } +unsigned getTemplateDepth(NamedDecl *TemplateParam) { + if (auto *TTP = dyn_cast(TemplateParam)) +return TTP->getDepth(); + if (auto *TTP = dyn_cast(Temp

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-03 Thread Erich Keane via llvm-branch-commits
@@ -2744,31 +2744,155 @@ bool hasDeclaredDeductionGuides(DeclarationName Name, DeclContext *DC) { return false; } +unsigned getTemplateDepth(NamedDecl *TemplateParam) { erichkeane wrote: are we in an anonymous namespace? Else this should be 'static'. htt

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-03 Thread Erich Keane via llvm-branch-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/90961 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-03 Thread Matheus Izvekov via llvm-branch-commits
@@ -2744,31 +2744,155 @@ bool hasDeclaredDeductionGuides(DeclarationName Name, DeclContext *DC) { return false; } +unsigned getTemplateDepth(NamedDecl *TemplateParam) { mizvekov wrote: I think this is potentially misleading, as we already have multiple unr

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-03 Thread Matheus Izvekov via llvm-branch-commits
@@ -2744,31 +2744,155 @@ bool hasDeclaredDeductionGuides(DeclarationName Name, DeclContext *DC) { return false; } +unsigned getTemplateDepth(NamedDecl *TemplateParam) { + if (auto *TTP = dyn_cast(TemplateParam)) +return TTP->getDepth(); + if (auto *TTP = dyn_cast(Temp

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-03 Thread Matheus Izvekov via llvm-branch-commits
@@ -2744,31 +2744,155 @@ bool hasDeclaredDeductionGuides(DeclarationName Name, DeclContext *DC) { return false; } +unsigned getTemplateDepth(NamedDecl *TemplateParam) { mizvekov wrote: ```suggestion unsigned getTemplateParameterDepth(NamedDecl *TemplatePar

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-03 Thread Younan Zhang via llvm-branch-commits
@@ -2744,31 +2744,155 @@ bool hasDeclaredDeductionGuides(DeclarationName Name, DeclContext *DC) { return false; } +unsigned getTemplateDepth(NamedDecl *TemplateParam) { + if (auto *TTP = dyn_cast(TemplateParam)) +return TTP->getDepth(); + if (auto *TTP = dyn_cast(Temp

[llvm-branch-commits] [clang] [clang] CTAD alias: fix the transformation for the require-clause expr (PR #90961)

2024-05-03 Thread Younan Zhang via llvm-branch-commits
@@ -2744,31 +2744,155 @@ bool hasDeclaredDeductionGuides(DeclarationName Name, DeclContext *DC) { return false; } +unsigned getTemplateDepth(NamedDecl *TemplateParam) { + if (auto *TTP = dyn_cast(TemplateParam)) +return TTP->getDepth(); + if (auto *TTP = dyn_cast(Temp