[clang] [clang] Substitute alias templates from correct context (PR #75069)

2023-12-14 Thread Jordan Rupprecht via cfe-commits
rupprecht wrote: Thanks to @MaskRay for handling the revert. A reduction for the second `typename` breakage looks similar, so may be the same underlying issue. But here it is anyway, in case it ends up being a second bug in the patch: ```c++ class Foo {}; template struct Ptr {}; template

[clang] [clang] Substitute alias templates from correct context (PR #75069)

2023-12-14 Thread Mariya Podchishchaeva via cfe-commits
Fznamznon wrote: @rupprecht , no, this is not expected. Please feel free to revert since it is night in my time zone. Otherwise I will revert tomorrow. https://github.com/llvm/llvm-project/pull/75069 ___ cfe-commits mailing list cfe-commits@lists.llvm

[clang] [clang] Substitute alias templates from correct context (PR #75069)

2023-12-14 Thread Jordan Rupprecht via cfe-commits
rupprecht wrote: After this commit, I'm seeing another "out-of-line definition" error for `operator=` on the following reduced snippet: ```c++ class Foo {}; template struct Stuff; template struct Stuff { Stuff& operator=(Stuff&& that); }; template using Alias = Stuff; template Alias&

[clang] [clang] Substitute alias templates from correct context (PR #75069)

2023-12-12 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon closed https://github.com/llvm/llvm-project/pull/75069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Substitute alias templates from correct context (PR #75069)

2023-12-12 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. https://github.com/llvm/llvm-project/pull/75069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Substitute alias templates from correct context (PR #75069)

2023-12-12 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon updated https://github.com/llvm/llvm-project/pull/75069 >From d0bfa140bdfa2be213151d4d17263bb60e6b46d3 Mon Sep 17 00:00:00 2001 From: "Podchishchaeva, Mariya" Date: Mon, 11 Dec 2023 08:31:15 -0800 Subject: [PATCH 1/2] [clang] Substitute alias templates from correct

[clang] [clang] Substitute alias templates from correct context (PR #75069)

2023-12-11 Thread Erich Keane via cfe-commits
@@ -3990,9 +3991,16 @@ QualType Sema::CheckTemplateIdType(TemplateName Name, if (Inst.isInvalid()) return QualType(); -CanonType = SubstType(Pattern->getUnderlyingType(), - TemplateArgLists, AliasTemplate->getLocation(), -

[clang] [clang] Substitute alias templates from correct context (PR #75069)

2023-12-11 Thread Mariya Podchishchaeva via cfe-commits
Fznamznon wrote: > Can you point out the diff from the previous patch? To fix the following case: ``` // Test case that regressed with the first iteration of the fix template class SP { T* data; }; template class A { static SP foo(); }; template using TRet = SP>; template TRet A::fo

[clang] [clang] Substitute alias templates from correct context (PR #75069)

2023-12-11 Thread Erich Keane via cfe-commits
erichkeane wrote: Can you point out the diff from the previous patch? https://github.com/llvm/llvm-project/pull/75069 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Substitute alias templates from correct context (PR #75069)

2023-12-11 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Mariya Podchishchaeva (Fznamznon) Changes Current context set to where alias was met, not where it is declared caused incorrect access check in case alias referenced private members of the parent class. This is a recommit of 6b1aa31 with

[clang] [clang] Substitute alias templates from correct context (PR #75069)

2023-12-11 Thread Mariya Podchishchaeva via cfe-commits
https://github.com/Fznamznon created https://github.com/llvm/llvm-project/pull/75069 Current context set to where alias was met, not where it is declared caused incorrect access check in case alias referenced private members of the parent class. This is a recommit of 6b1aa31 with a slight modi