[clang] Revert "Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (#111852)" (PR #115159)

2024-12-06 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @zyn0217 Sorry, I've not had time to work on this recently. I have a branch ready which _should_ address the issues encountered thus far, but I haven't fully tested it yet. I should have time after the weekend. https://github.com/llvm/llvm-project/pull/115159

[clang] [libcxx] [Clang] Implement CWG2369 "Ordering between constraints and substitution" (PR #102857)

2024-11-25 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: FWIW, I'm going to try reland the `getTemplateInstantiationArgs` refactoring again this week. https://github.com/llvm/llvm-project/pull/102857 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [Clang] Fix name lookup for dependent bases (PR #114978)

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

[clang] [Clang] Fix name lookup for dependent bases (PR #114978)

2024-11-15 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian commented: I don't think this patch fixes the following case: ```cpp template struct A { struct B { using X = int; struct C { using X = void; struct D; }; }; }; template struct A::B::C::D : B

[clang] [Clang][Comments] Make @relates an inline comment command (PR #115040)

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

[clang] [Clang][Comments] Make @relates an inline comment command (PR #115040)

2024-11-11 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @AaronBallman Test added https://github.com/llvm/llvm-project/pull/115040 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Comments] Make @relates an inline comment command (PR #115040)

2024-11-11 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/115040 >From cba8a46cd0dcbdf5079712354e5d0829199e0e08 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 5 Nov 2024 12:59:42 -0500 Subject: [PATCH 1/2] [Clang][Comments] Make @relates an inline comment co

[clang] [Clang] Fix name lookup for dependent bases (PR #114978)

2024-11-11 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @vbe-sc I can later today or tomorrow. https://github.com/llvm/llvm-project/pull/114978 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang][Sema] Use the correct injected template arguments for partial specializations when collecting multi-level template argument lists (#112381)" (PR #115157)

2024-11-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/115157 This reverts commit 9381c6fd04cc16a7606633f57c96c11e58181ddb. >From 026f442bd600bd50921bdcfe550b5ff4c376066e Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 6 Nov 2024 08:28:50 -0500 Subject: [

[clang] [Clang][Test] Update test after #115159 (PR #115172)

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

[clang] [Clang][Test] Update test after #115159 (PR #115172)

2024-11-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/115172 After #111852 was reverted in #115159, two tests now fail because they partially depend on its changes. This patch temporarily fixes the failing cases by updating the expected output to match the actual outp

[clang] Revert "Reapply "[Clang][Sema] Always use latest redeclaration of primary template" (#114569)" (PR #115156)

2024-11-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/115156 This reverts commit b24650e814e55d90acfc40acf045456c98f32b9c. >From 026f442bd600bd50921bdcfe550b5ff4c376066e Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 6 Nov 2024 08:28:50 -0500 Subject: [

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

2024-11-06 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @alexfh @wlei-llvm Please send a repro when you can! https://github.com/llvm/llvm-project/pull/111852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (#111852)" (PR #115159)

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

[clang] Revert "[Clang][Sema] Use the correct injected template arguments for partial specializations when collecting multi-level template argument lists (#112381)" (PR #115157)

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

[clang] Revert "[Clang][Sema] Use the correct injected template arguments for partial specializations when collecting multi-level template argument lists (#112381)" (PR #115157)

2024-11-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/115157 >From d36ee37cdba49332d36ab8204826e50614359e82 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 6 Nov 2024 08:36:04 -0500 Subject: [PATCH] Revert "[Clang][Sema] Use the correct injected template

[clang] Revert "Reapply "[Clang][Sema] Always use latest redeclaration of primary template" (#114569)" (PR #115156)

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

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

2024-11-06 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Reverted in #115156, #115157, and #115159. https://github.com/llvm/llvm-project/pull/111852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Comments] Make @relates an inline comment command (PR #115040)

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

[clang] [Clang][Comments] Make @relates an inline comment command (PR #115040)

2024-11-05 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/115040 According to the [Doxygen documentation](https://www.doxygen.nl/manual/commands.html#cmdrelates), the `relates`, `related`, `relatesalso`, and `relatedalso` commands all have a single argument. This patch c

[clang] Reapply "[Clang][Sema] Always use latest redeclaration of primary template" (PR #114569)

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

[clang] Reapply "[Clang][Sema] Always use latest redeclaration of primary template" (PR #114569)

2024-11-01 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/114569 >From 3764c063acd6f296b1f55f66f7cd7542d1b5c5ae Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 31 Oct 2024 13:52:21 -0400 Subject: [PATCH 1/3] Reapply "[Clang][Sema] Always use latest redeclarat

[clang] Reapply "[Clang][Sema] Always use latest redeclaration of primary template" (PR #114569)

2024-11-01 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Great! Hopefully this will be the last PR needed to finally get #106585 working :) https://github.com/llvm/llvm-project/pull/114569 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] Reapply "[Clang][Sema] Always use latest redeclaration of primary template" (PR #114569)

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

[clang] Reapply "[Clang][Sema] Always use latest redeclaration of primary template" (PR #114569)

2024-11-01 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/114569 This patch fixes an infinite recursion bug in `ASTImporter` that occurs when importing the primary template of a class template specialization when the latest redeclaration of that template is a friend decla

[clang] [Clang][Sema] Always use latest redeclaration of primary template (PR #114258)

2024-11-01 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Once I finish writing tests, I'll open a PR to reapply this patch https://github.com/llvm/llvm-project/pull/114258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Always use latest redeclaration of primary template (PR #114258)

2024-10-31 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > Yup, that fixes the issue. I've also confirmed that reverting the fix brings > back the crash! Great! > It is weird that you were unable to repro this 🤔 (or rather that it was also > crashing when you reverted the original patch...) Are you 100% sure you > recompiled LLDB

[clang] [Clang][Sema] Always use latest redeclaration of primary template (PR #114258)

2024-10-31 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @felipepiovezan I tested without this patch applied and was still seeing crashes... could you perhaps see if https://github.com/sdkrystian/llvm-project/tree/reapply-use-latest-primary fixes the regression? https://github.com/llvm/llvm-project/pull/114258

[clang] [Clang][Sema] Always use latest redeclaration of primary template (PR #114258)

2024-10-30 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: I should hopefully have a fix ready tomorrow... apologies for the delay @asmok-g! Getting this patch right is a bit hard since it touches all template instantiation related things :) https://github.com/llvm/llvm-project/pull/114258

[clang] [Clang][Sema] Always use latest redeclaration of primary template (PR #114258)

2024-10-30 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane @felipepiovezan Given that all the failing tests relate to expression evaluation within modules, I think the problem is in `ASTImporter`. https://github.com/llvm/llvm-project/pull/114258 ___ cfe-commits mailing list cfe-c

[clang] [Clang][Sema] Always use latest redeclaration of primary template (PR #114258)

2024-10-30 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @asmok-g You're in luck, because I was just about to merge this now :) https://github.com/llvm/llvm-project/pull/114258 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [Clang][Sema] Always use latest redeclaration of primary template (PR #114258)

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

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

2024-10-30 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @asmok-g @usx95 @steelannelida I have a fix ready in #114258 https://github.com/llvm/llvm-project/pull/111852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Always use latest redeclaration of primary template (PR #114258)

2024-10-30 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/114258 This patch fixes a couple of regressions introduced in #111852. Consider: ```cpp template struct A { template static constexpr bool f() requires U { return true; } }; template<> temp

[clang] [Clang][Sema] Always use latest redeclaration of primary template (PR #114258)

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

[clang] [Clang][Sema] Ignore previous partial specializations of member class templates explicitly specialized for a implicitly instantiated class template specialization (PR #113464)

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

[clang] [Clang][Sema] Ignore previous partial specializations of member class templates explicitly specialized for a implicitly instantiated class template specialization (PR #113464)

2024-10-30 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/113464 >From 7542bda555601ed537dd9bacde65537021cf402d Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 23 Oct 2024 10:28:23 -0400 Subject: [PATCH 1/4] [Clang][Sema] Ignore previous partial specializatio

[clang] [Clang][Sema] Ignore previous partial specializations of member class templates explicitly specialized for a implicitly instantiated class template specialization (PR #113464)

2024-10-30 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/113464 >From 7542bda555601ed537dd9bacde65537021cf402d Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 23 Oct 2024 10:28:23 -0400 Subject: [PATCH 1/5] [Clang][Sema] Ignore previous partial specializatio

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

2024-10-30 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @adam-smnk Should have the fix merged today https://github.com/llvm/llvm-project/pull/111852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AST] Store injected template arguments in TemplateParameterList (PR #113579)

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

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

2024-10-29 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @usx95 Minimal reproducer: ```cpp // input.cppm export module input; export template constexpr int f(); template class B { template friend constexpr int f(); }; template struct B<0>; template constexpr int f() { return N; } ``` ```cpp // input.cpp import input; st

[clang] [Clang][AST] Store injected template arguments in TemplateParameterList (PR #113579)

2024-10-29 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/113579 >From 95c86a7036e62240ab7704f0b1e47cdc9ac437c6 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 15 Oct 2024 11:15:55 -0400 Subject: [PATCH 1/3] [Clang][AST] Store injected template arguments in

[clang] [Clang][AST] Store injected template arguments in TemplateParameterList (PR #113579)

2024-10-29 Thread Krystian Stasiowski via cfe-commits
@@ -51,14 +51,15 @@ DefaultTemplateArgumentContainsUnexpandedPack(const TemplateParam &P) { P.getDefaultArgument().getArgument().containsUnexpandedParameterPack(); } -TemplateParameterList::TemplateParameterList(const ASTContext& C, +TemplateParameterList::TemplateP

[clang] [Clang][AST] Store injected template arguments in TemplateParameterList (PR #113579)

2024-10-29 Thread Krystian Stasiowski via cfe-commits
@@ -51,14 +51,15 @@ DefaultTemplateArgumentContainsUnexpandedPack(const TemplateParam &P) { P.getDefaultArgument().getArgument().containsUnexpandedParameterPack(); } -TemplateParameterList::TemplateParameterList(const ASTContext& C, +TemplateParameterList::TemplateP

[clang] [Clang][AST] Store injected template arguments in TemplateParameterList (PR #113579)

2024-10-25 Thread Krystian Stasiowski via cfe-commits
@@ -51,14 +51,15 @@ DefaultTemplateArgumentContainsUnexpandedPack(const TemplateParam &P) { P.getDefaultArgument().getArgument().containsUnexpandedParameterPack(); } -TemplateParameterList::TemplateParameterList(const ASTContext& C, +TemplateParameterList::TemplateP

[clang] [Clang][AST] Store injected template arguments in TemplateParameterList (PR #113579)

2024-10-25 Thread Krystian Stasiowski via cfe-commits
@@ -51,14 +51,15 @@ DefaultTemplateArgumentContainsUnexpandedPack(const TemplateParam &P) { P.getDefaultArgument().getArgument().containsUnexpandedParameterPack(); } -TemplateParameterList::TemplateParameterList(const ASTContext& C, +TemplateParameterList::TemplateP

[clang] [Clang][AST] Store injected template arguments in TemplateParameterList (PR #113579)

2024-10-25 Thread Krystian Stasiowski via cfe-commits
@@ -244,6 +245,17 @@ bool TemplateParameterList::hasAssociatedConstraints() const { return HasRequiresClause || HasConstrainedParameters; } +ArrayRef TemplateParameterList::getInjectedTemplateArgs() { + if (const auto *Context = InjectedArgs.dyn_cast()) { +TemplateArgu

[clang] [Clang][AST] Store injected template arguments in TemplateParameterList (PR #113579)

2024-10-25 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/113579 >From 95c86a7036e62240ab7704f0b1e47cdc9ac437c6 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 15 Oct 2024 11:15:55 -0400 Subject: [PATCH 1/2] [Clang][AST] Store injected template arguments in

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

2024-10-25 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @steelannelida I'm unable to reproduce this error... by "module" do you mean C++ module (a la `export module ...`)? If you can provide a godbolt like that would be greatly appreciated :) https://github.com/llvm/llvm-project/pull/111852

[clang] [Clang][AST] Store injected template arguments in TemplateParameterList (PR #113579)

2024-10-25 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/113579 Currently, we store injected template arguments in `RedeclarableTemplateDecl::CommonBase`. This approach has a couple problems: 1. We can only access the injected template arguments of `RedeclarableTemplateD

[clang] [Clang][AST] Store injected template arguments in TemplateParameterList (PR #113579)

2024-10-24 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/113579 >From 95c86a7036e62240ab7704f0b1e47cdc9ac437c6 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 15 Oct 2024 11:15:55 -0400 Subject: [PATCH] [Clang][AST] Store injected template arguments in Temp

[clang] [Clang][Sema] Ignore previous partial specializations of member class templates explicitly specialized for a implicitly instantiated class template specialization (PR #113464)

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

[clang] [Clang][Sema] Ignore previous partial specializations of member classtemplates explicitly specialized for a implicitly instantiated class template specialization (PR #113464)

2024-10-23 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/113464 Consider the following: ```cpp template struct A { template struct B { static constexpr int x = 0; // #1 }; template struct B { static constexpr int x = 1; // #2 }; }; template<> template

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

2024-10-22 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: I've (unfortunately) stumbled upon a crash caused by this patch: ```cpp template struct A { template static constexpr bool f() requires U { return true; } }; template<> template constexpr bool A::f() requires U { return A::f(); } template<> templat

[clang] [Clang][Sema] Fix exception specification comparison for functions with different template depths (PR #111561)

2024-10-22 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/111561 >From d41114109ebfb98570152fe8fdc2854863f23397 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 8 Oct 2024 12:54:26 -0400 Subject: [PATCH 1/4] [Clang][Sema] Fix exception specification comparison

[clang] [Clang][Sema] Fix exception specification comparison for functions with different template depths (PR #111561)

2024-10-18 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/111561 >From 8fe948147c63311600994a0d846a3ad0bce95f2a Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 8 Oct 2024 12:54:26 -0400 Subject: [PATCH 1/4] [Clang][Sema] Fix exception specification comparison

[clang] [Clang][Sema] Fix exception specification comparison for functions with different template depths (PR #111561)

2024-10-18 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/111561 >From dd1095566251508aae4009a626774413eb8dc7a1 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 8 Oct 2024 12:54:26 -0400 Subject: [PATCH 1/4] [Clang][Sema] Fix exception specification comparison

[clang] [Clang][Sema] Fix exception specification comparison for functions with different template depths (PR #111561)

2024-10-18 Thread Krystian Stasiowski via cfe-commits
@@ -501,6 +519,89 @@ bool Sema::CheckEquivalentExceptionSpec( return Result; } +static const Expr *SubstituteExceptionSpecWithoutEvaluation( +Sema &S, const Sema::TemplateCompareNewDeclInfo &DeclInfo, +const Expr *ExceptionSpec) { + MultiLevelTemplateArgumentList ML

[clang] [Clang][Sema] Fix exception specification comparison for functions with different template depths (PR #111561)

2024-10-18 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/111561 >From dd1095566251508aae4009a626774413eb8dc7a1 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 8 Oct 2024 12:54:26 -0400 Subject: [PATCH 1/3] [Clang][Sema] Fix exception specification comparison

[clang] [Clang][Sema] Fix exception specification comparison for functions with different template depths (PR #111561)

2024-10-17 Thread Krystian Stasiowski via cfe-commits
@@ -501,6 +519,89 @@ bool Sema::CheckEquivalentExceptionSpec( return Result; } +static const Expr *SubstituteExceptionSpecWithoutEvaluation( +Sema &S, const Sema::TemplateCompareNewDeclInfo &DeclInfo, +const Expr *ExceptionSpec) { + MultiLevelTemplateArgumentList ML

[clang] [Clang][Sema] Use the correct injected template arguments for partial specializations when collecting multi-level template argument lists (PR #112381)

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

[clang] [Clang][Sema] Use the correct injected template arguments for partial specializations when collecting multi-level template argument lists (PR #112381)

2024-10-16 Thread Krystian Stasiowski via cfe-commits
@@ -2085,7 +2085,9 @@ class ClassTemplateSpecializationDecl : public CXXRecordDecl, class ClassTemplatePartialSpecializationDecl : public ClassTemplateSpecializationDecl { /// The list of template parameters - TemplateParameterList* TemplateParams = nullptr; + TemplatePa

[clang] [Clang][Sema] Use the correct injected template arguments for partial specializations when collecting multi-level template argument lists (PR #112381)

2024-10-16 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/112381 >From 146b209c90a5ced513ec886882ed57ce09ca2f56 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 15 Oct 2024 09:52:43 -0400 Subject: [PATCH 1/3] [Clang][Sema] Use the correct injected template arg

[clang] [Clang][Sema] Use the correct injected template arguments for partial specializations when collecting multi-level template argument lists (PR #112381)

2024-10-15 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/112381 >From 146b209c90a5ced513ec886882ed57ce09ca2f56 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 15 Oct 2024 09:52:43 -0400 Subject: [PATCH 1/2] [Clang][Sema] Use the correct injected template arg

[clang] [Clang][Sema] Use the correct injected template arguments for partial specializations when collecting multi-level template argument lists (PR #112381)

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

[clang] [Clang][Sema] Use the correct injected template arguments for partial specializations when collecting multi-level template argument lists (PR #112381)

2024-10-15 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/112381 After #111852 refactored multi-level template argument list collection, the following results in a crash: ```cpp template struct A; template struct A { void f() requires B; }; template void A::f() requi

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

2024-10-14 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > Could you dive a little deeper why this change is necessary? E.g. does the > most recent redecl have some properties that the canonical declaration (which > would be the first one) does not? @ilya-biryukov When instantiating a template from a member template that was expli

[clang] [Clang][Sema] Fix exception specification comparison for functions with different template depths (PR #111561)

2024-10-14 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/111561 >From 5c4f2cfef564a0e6fc363e2f79fa7488b4f39eb9 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 8 Oct 2024 12:54:26 -0400 Subject: [PATCH 1/2] [Clang][Sema] Fix exception specification comparison

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

2024-10-14 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @ilya-biryukov This is caused by the change to `CheckFunctionTemplateSpecialization` in `SemaTemplate.cpp`; we previously called `DeduceTemplateArguments` with the canonical declaration of the primary template, but now we call it with the passed in primary template declaratio

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

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

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

2024-10-10 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @mstorsjo Tested this patch with QT and it builds without issue. https://github.com/llvm/llvm-project/pull/111852 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

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

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (PR #111852)

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

[clang] Revert "[clang] Track function template instantiation from definition (#110387)" (PR #111764)

2024-10-09 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @mizvekov Sorry, will do so in the future! https://github.com/llvm/llvm-project/pull/111764 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (#111173)" (PR #111766)

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

[clang] Revert "[clang] Track function template instantiation from definition (#110387)" (PR #111764)

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

[clang] Revert "[clang] Track function template instantiation from definition (#110387)" (PR #111764)

2024-10-09 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/111764 This reverts commit 4336f00f2156970cc0af2816331387a0a4039317. >From 79468220ab383f24a86a3c52e0bf02a829992c5f Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 9 Oct 2024 17:42:58 -0400 Subject: [

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

2024-10-09 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @mschessler Sorry, I meant @mstorsjo :) https://github.com/llvm/llvm-project/pull/73 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

2024-10-09 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @mschessler Unless @erichkeane, @zyn0217, or @mizvekov object, I think we should merge the original embodiment of my reapplication of the patch. https://github.com/llvm/llvm-project/pull/73 ___ cfe-commits mailing list cfe-commi

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

2024-10-09 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @mizvekov So, after some experimentation, I think the correct solution is my original change which augments `getPrimaryTemplate` and related functions to return the most recent declaration. Otherwise, the number of cases where we accidentally use the wrong definition of a fun

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

2024-10-09 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > Do you think you'll have a fix within a couple of hours @mstorsjo I think so. If not, I'll revert. https://github.com/llvm/llvm-project/pull/73 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

2024-10-09 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Reduced to: ```cpp template struct A { template static constexpr int f(); }; template<> template constexpr int A<0>::f() { return A<1>::f(); } template<> template constexpr int A<1>::f() { return J; } static_assert(A<0>::f<2>() == 2); // error: static assertio

[clang] [Clang][Sema] Fix exception specification comparison for functions with different template depths (PR #111561)

2024-10-08 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/111561 >From da01bdac8a99a127a74073df4a505bdc936291e2 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 8 Oct 2024 12:54:26 -0400 Subject: [PATCH 1/2] [Clang][Sema] Fix exception specification comparison

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

2024-10-08 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > FYI I just realized the Final parameter is not wired up to the Collecter. It > appertains to the Innermost argument. Oops! I don't think it affects functionality though, so it can probably be addressed in a follow-up patch https://github.com/llvm/llvm-project/pull/73 _

[clang] [Clang][Sema] Fix exception specification comparison for functions with different template depths (PR #111561)

2024-10-08 Thread Krystian Stasiowski via cfe-commits
@@ -574,6 +675,7 @@ static bool CheckEquivalentExceptionSpecImpl( } } +#if 0 sdkrystian wrote: Just an implementation remnant, I'll remove it :) https://github.com/llvm/llvm-project/pull/111561 ___ cfe-commit

[clang] [Clang][Sema] Fix exception specification comparison for functions with different template depths (PR #111561)

2024-10-08 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/111561 Currently, we do not account for differences in template depth when comparing exception specifications for equivalence. This results in explicit specializations of member function templates specialized for a

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

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

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

2024-10-07 Thread Krystian Stasiowski via cfe-commits
@@ -4159,7 +4159,7 @@ FunctionTemplateDecl *FunctionDecl::getPrimaryTemplate() const { if (FunctionTemplateSpecializationInfo *Info = TemplateOrSpecialization .dyn_cast()) { -return Info->getTemplate(); +return Info->getTemplate()->getMostRecentDe

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

2024-10-07 Thread Krystian Stasiowski via cfe-commits
@@ -4159,7 +4159,7 @@ FunctionTemplateDecl *FunctionDecl::getPrimaryTemplate() const { if (FunctionTemplateSpecializationInfo *Info = TemplateOrSpecialization .dyn_cast()) { -return Info->getTemplate(); +return Info->getTemplate()->getMostRecentDe

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

2024-10-04 Thread Krystian Stasiowski via cfe-commits
@@ -4159,7 +4159,7 @@ FunctionTemplateDecl *FunctionDecl::getPrimaryTemplate() const { if (FunctionTemplateSpecializationInfo *Info = TemplateOrSpecialization .dyn_cast()) { -return Info->getTemplate(); +return Info->getTemplate()->getMostRecentDe

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

2024-10-04 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @zyn0217 I have quite a few test cases I'll be adding soon https://github.com/llvm/llvm-project/pull/73 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

2024-10-04 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane All changes made since the last review are in dfa5179f07b5a85c1daafd93b9f1d4bed9b4e27b https://github.com/llvm/llvm-project/pull/73 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

2024-10-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/73 >From 51f84ce80ddda9e12591f263a24a19238fc69cb8 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 23 Sep 2024 10:51:21 -0400 Subject: [PATCH 1/2] Reapply "[Clang][Sema] Refactor collection of multi

[clang] Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (PR #111173)

2024-10-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/73 Reapplies #106585, fixing an issue where non-dependent names of member templates appearing prior to that member template being explicitly specialized for an implicitly instantiated class template specializat

[clang] [Clang][Sema] fix noexecpt mismatch of friend declaration (PR #102267)

2024-10-04 Thread Krystian Stasiowski via cfe-commits
@@ -4698,7 +4698,22 @@ void Sema::InstantiateExceptionSpec(SourceLocation PointOfInstantiation, // Enter the scope of this instantiation. We don't use // PushDeclContext because we don't have a scope. Sema::ContextRAII savedContext(*this, Decl); + + FunctionDecl *Source

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-09-30 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @zyn0217 I plan to reapply the patch after addressing the issues discussed above, but I have to get some more pressing work stuff done first :) https://github.com/llvm/llvm-project/pull/106585 ___ cfe-commits mailing list cfe-commits

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-09-24 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Another example using class templates: ```cpp template struct A { template struct B; }; template<> template struct A<0>::B : A<1>::B { }; template<> template struct A<1>::B { static constexpr bool x = true; }; static_assert(A<0>::B::x); // error: implicit instanti

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-09-23 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Reduced further to: ```cpp template struct A { template static constexpr bool f(); }; template<> template constexpr bool A<0>::f() { return A<1>::f(); // note: undefined function 'f' cannot be used in a constant expression } template<> template constexpr bool A<1>

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

2024-09-23 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: I've manually reduced the standalone reproducer to the following: ```cpp template struct A { template static constexpr bool f(); }; template<> template constexpr bool A<0>::f() { return A<1>::f(); } template<> template constexpr bool A<1>::f() { return true; }

[clang] [Clang][Sema] Refactor collection of multi-level template argument lists (PR #106585)

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

  1   2   3   4   5   6   7   8   9   10   >