[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-27 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: See #79683 https://github.com/llvm/llvm-project/pull/78274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-24 Thread via cfe-commits
cor3ntin wrote: Just this case, so that people can disable it in their code. It's really a backward compatibility/transition period concern. https://github.com/llvm/llvm-project/pull/78274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-24 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @cor3ntin @AaronBallman I can work on reapplying this tomorrow. Do we want a flag that allows _all_ template parameter shadowing as a warning, or only in this particular case? https://github.com/llvm/llvm-project/pull/78274 ___ cfe

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-21 Thread via cfe-commits
https://github.com/cor3ntin commented: Separate default-to-error warning sounds like the right approach given the fallout. We will need a way to identify that the shadowing declaration is the declaration the template parameter is attached to, so I suspect that change isn't trivial. I'll reve

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-21 Thread via cfe-commits
alexfh wrote: We've got a huge amount of fallout from this change too. The cleanup would require a lot of work. This compiler error (though useful) definitely needs to be a diagnostic with a separate disable flag with at least one release of grace period. For now, I suggest to revert the chang

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-20 Thread David Blaikie via cfe-commits
dwblaikie wrote: > @zmodem template parameter shadowing is an extension with > `-fms-compatibility`, if that works Given the prevalence (wellr, given how quickly folks have tripped over it probably indicates it's fairly prevalent), I think it'll need to be/should be pulled out into its own wa

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-18 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @zmodem template parameter shadowing is an extension with `-fms-compatibility`, if that works https://github.com/llvm/llvm-project/pull/78274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-18 Thread via cfe-commits
zmodem wrote: Obviously we have some code where this fires :-) First hit is https://source.chromium.org/chromium/chromium/src/+/main:third_party/libunwindstack/src/libartbase/base/stl_util.h;l=296 ``` template static inline IterationRange> Filter( IterationRange it, Filter cond) { auto

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-17 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/78274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-17 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/78274 >From 4ac6eb855fc302214a0cd0bcd15af351981eaf02 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 16 Jan 2024 08:05:33 -0500 Subject: [PATCH] [Clang][Sema] Diagnose function/variable templates that

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

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

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Krystian Stasiowski via cfe-commits
@@ -6070,7 +6070,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, /// /// The result of this call will never be null, but the associated /// type may be a null type if there's an unrecoverable error. -TypeSourceInfo *Sema::GetTypeForDeclarator(D

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/78274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/78274 >From 90d66e29f3550d50bd114d68fc8b12156e26de18 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 16 Jan 2024 08:05:33 -0500 Subject: [PATCH] [Clang][Sema] Diagnose function/variable templates that

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Erich Keane via cfe-commits
@@ -6070,7 +6070,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, /// /// The result of this call will never be null, but the associated /// type may be a null type if there's an unrecoverable error. -TypeSourceInfo *Sema::GetTypeForDeclarator(D

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Krystian Stasiowski via cfe-commits
@@ -6070,7 +6070,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, /// /// The result of this call will never be null, but the associated /// type may be a null type if there's an unrecoverable error. -TypeSourceInfo *Sema::GetTypeForDeclarator(D

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Erich Keane via cfe-commits
@@ -6070,7 +6070,7 @@ static TypeSourceInfo *GetFullTypeForDeclarator(TypeProcessingState &state, /// /// The result of this call will never be null, but the associated /// type may be a null type if there's an unrecoverable error. -TypeSourceInfo *Sema::GetTypeForDeclarator(D

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: A vast majority of this is parser related, and I'm not super familiar there, so @cor3ntin is likely a better reviewer here. https://github.com/llvm/llvm-project/pull/78274 ___ cfe-commits mailing list cfe-commi

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Alright, I've applied. Thanks! https://github.com/llvm/llvm-project/pull/78274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Erich Keane via cfe-commits
erichkeane wrote: > @erichkeane I don't think I can add reviewers [without write access to the > repo](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review) > unfortunately I've not seen oth

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane I don't think I can add reviewers [without write access to the repo](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/requesting-a-pull-request-review) unfortunately https://github.com/llvm

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Erich Keane via cfe-commits
erichkeane wrote: > Ping @erichkeane (if you are already being pinged automatically please let me > know so I'm not double-pinging :) ) Rather than doing this, please just add a few folks ot the 'reviewers' list on the RHS of the PR interface. It pings us as a part of it. https://github.com/

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/78274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/78274 >From 03e0e75c2793de4429b15acdbd04382ee45b7952 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 16 Jan 2024 06:28:35 -0500 Subject: [PATCH 1/2] [Clang][Sema][NFC] Remove unused Scope* parameter fr

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Ping @erichkeane (if you are already being pinged automatically please let me know so I'm not double-pinging :) ) https://github.com/llvm/llvm-project/pull/78274 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/78274 >From cdd6d0d441a9d2cbd6670890ea2d0c8caff074d1 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 16 Jan 2024 06:28:35 -0500 Subject: [PATCH 1/2] [Clang][Sema][NFC] Remove unused Scope* parameter fr

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/78274 >From cdd6d0d441a9d2cbd6670890ea2d0c8caff074d1 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 16 Jan 2024 06:28:35 -0500 Subject: [PATCH 1/2] [Clang][Sema][NFC] Remove unused Scope* parameter fr

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: Krystian Stasiowski (sdkrystian) Changes Previously, we skipped through template parameter scopes (until we hit a declaration scope) prior to redeclaration lookup for declarators. For template declarations, the meant that their template p

[clang] [Clang][Sema] Diagnose function/variable templates that shadow their own template parameters (PR #78274)

2024-01-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/78274 Previously, we skipped through template parameter scopes (until we hit a declaration scope) prior to redeclaration lookup for declarators. For template declarations, the meant that their template parameters w