[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

[clang] [clang] Fix false warning on reinterpret_casting unknown template type (PR #109430)

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

[clang] [clang] Fix false warning on reinterpret_casting unknown template type (PR #109430)

2024-09-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian requested changes to this pull request. https://github.com/llvm/llvm-project/pull/109430 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix false warning on reinterpret_casting unknown template type (PR #109430)

2024-09-20 Thread Krystian Stasiowski via cfe-commits
@@ -2092,6 +2092,10 @@ void Sema::CheckCompatibleReinterpretCast(QualType SrcType, QualType DestType, } } + if (SrcTy->isTemplateTypeParmType() || DestTy->isTemplateTypeParmType()) { sdkrystian wrote: This should probably be`if (SrcTy->isDependentType

[clang] Reapply "[Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (#104458)" (PR #109422)

2024-09-20 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > Does this need a release note? I don't think so, since this fixes a bug introduced in the same release. > Also, can you point out the 'diff' from the previous commit? The condition of [the assert in `SemaExprCXX.cpp`](https://github.com/llvm/llvm-project/pull/109422/files

[clang] Reapply "[Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (#104458)" (PR #109422)

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

[clang] Reapply "[Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (#104458)" (PR #109422)

2024-09-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/109422 >From d1b0cad696cca10c28ba32c290bc220ee917b48d Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 15 Aug 2024 11:27:34 -0400 Subject: [PATCH 1/8] Reapply "[Clang][Sema] Use the correct lookup conte

[clang] Reapply "[Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (#104458)" (PR #109422)

2024-09-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/109422 Reapplies #104458, fixing a bug that occurs when a templated class declares `operator->` to return a non-dependent class type. >From d1b0cad696cca10c28ba32c290bc220ee917b48d Mon Sep 17 00:00:00 2001 From: Kr

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

2024-09-17 Thread Krystian Stasiowski via cfe-commits
@@ -585,8 +585,8 @@ static bool CheckConstraintSatisfaction( ArrayRef TemplateArgs = TemplateArgsLists.getNumSubstitutedLevels() > 0 - ? TemplateArgsLists.getOutermost() - : ArrayRef {}; + ? TemplateArgsLists.getInnermost() s

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-17 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @porglezomp Sorry, I'm currently at cppcon but I'll try reland it when I have a moment. https://github.com/llvm/llvm-project/pull/104458 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

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

2024-09-17 Thread Krystian Stasiowski via cfe-commits
@@ -585,8 +585,8 @@ static bool CheckConstraintSatisfaction( ArrayRef TemplateArgs = TemplateArgsLists.getNumSubstitutedLevels() > 0 - ? TemplateArgsLists.getOutermost() - : ArrayRef {}; + ? TemplateArgsLists.getInnermost() s

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

2024-09-17 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Ping @erichkeane 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

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

2024-09-17 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @ericniebler Once I merge #106585, I have a follow up patch ready that will fix #101330. https://github.com/llvm/llvm-project/pull/102267 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-13 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: I have a fix, so I'll reapply this sometime today. https://github.com/llvm/llvm-project/pull/104458 ___ 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 lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-09 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/104458 ___ 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 lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-09 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/104458 ___ 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 lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-09 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/104458 >From 11f67c73a8de04ce94dbed467de043668234e202 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 15 Aug 2024 11:27:34 -0400 Subject: [PATCH 1/5] [Clang][Sema] Use the correct lookup context when

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-09 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/104458 >From 11f67c73a8de04ce94dbed467de043668234e202 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 15 Aug 2024 11:27:34 -0400 Subject: [PATCH 1/4] [Clang][Sema] Use the correct lookup context when

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/104458 ___ 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 lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-04 Thread Krystian Stasiowski via cfe-commits
@@ -7981,7 +7969,7 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base, SmallVector OperatorArrows; CTypes.insert(Context.getCanonicalType(BaseType)); -while (BaseType->isRecordType()) { +while (BaseType->getAsRecordDecl()) {

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-03 Thread Krystian Stasiowski via cfe-commits
@@ -7981,7 +7969,7 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base, SmallVector OperatorArrows; CTypes.insert(Context.getCanonicalType(BaseType)); -while (BaseType->isRecordType()) { +while (BaseType->getAsRecordDecl()) {

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-03 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/104458 >From a719de89be6af3607f67baddd8868f8e0fc7882f Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 15 Aug 2024 11:27:34 -0400 Subject: [PATCH 1/3] [Clang][Sema] Use the correct lookup context when

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-03 Thread Krystian Stasiowski via cfe-commits
@@ -7939,7 +7927,14 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base, } } return ExprError(); + } else if (Result.isUnset()) { +// BuildOverloadedArrowExpr returns an empty expression to indicate +// that we n

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-03 Thread Krystian Stasiowski via cfe-commits
@@ -7939,7 +7927,14 @@ ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base, } } return ExprError(); + } else if (Result.isUnset()) { +// BuildOverloadedArrowExpr returns an empty expression to indicate +// that we n

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-03 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @cor3ntin Excellent, then I think this is good to go https://github.com/llvm/llvm-project/pull/104458 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-09-03 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Ping @mizvekov 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

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-09-03 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @cor3ntin After giving it another look, I think the existing tests are sufficient (the tests updated by this PR were written by me to test this exact scenario). WDYT? https://github.com/llvm/llvm-project/pull/104458 ___ cfe-commits

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

2024-09-03 Thread Krystian Stasiowski via cfe-commits
@@ -2112,6 +2078,33 @@ DeclResult Sema::CheckClassTemplate( NewClass->setLexicalDeclContext(CurContext); NewTemplate->setLexicalDeclContext(CurContext); + // Ensure that the template parameter lists are compatible. Skip this check + // for a friend in a dependent context

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

2024-09-03 Thread Krystian Stasiowski via cfe-commits
@@ -33,11 +33,12 @@ class D{}; // expected-note{{previous definition is here}} template class D{}; // expected-error{{class template partial specialization does not specialize any template argument; to define the primary template, remove the template argument list}} expected-e

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

2024-08-30 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited 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

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

2024-08-30 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > Also, do you plan to fix #102320 in this or the follow-up patches? @zyn0217 This patch (in its current state) fixes #102320 :) https://github.com/llvm/llvm-project/pull/106585 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2024-08-30 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited 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

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

2024-08-30 Thread Krystian Stasiowski via cfe-commits
@@ -1669,25 +1640,43 @@ namespace { ExprResult RebuildLambdaExpr(SourceLocation StartLoc, SourceLocation EndLoc, LambdaScopeInfo *LSI) { +#if 1 CXXMethodDecl *MD = LSI->CallOperator; - for (ParmVarDecl *PVD : MD->parameters())

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

2024-08-30 Thread Krystian Stasiowski via cfe-commits
@@ -171,374 +139,379 @@ bool isLambdaEnclosedByTypeAliasDecl( .TraverseType(Underlying); } -// Add template arguments from a variable template instantiation. -Response -HandleVarTemplateSpec(const VarTemplateSpecializationDecl *VarTemplSpec, -

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

2024-08-30 Thread Krystian Stasiowski via cfe-commits
@@ -1056,16 +1052,20 @@ bool Sema::AreConstraintExpressionsEqual(const NamedDecl *Old, bool Sema::FriendConstraintsDependOnEnclosingTemplate(const FunctionDecl *FD) { assert(FD->getFriendObjectKind() && "Must be a friend!"); + FunctionTemplateDecl *FTD = FD->getDescribedFu

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

2024-08-30 Thread Krystian Stasiowski via cfe-commits
@@ -317,7 +317,8 @@ struct ConvertConstructorToDeductionGuideTransform { } if (NestedPattern) - OuterInstantiationArgs = SemaRef.getTemplateInstantiationArgs(Template); + OuterInstantiationArgs = SemaRef.getTemplateInstantiationArgs( + /*D=*/nullptr,

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

2024-08-30 Thread Krystian Stasiowski via cfe-commits
@@ -809,8 +809,9 @@ class RedeclarableTemplateDecl : public TemplateDecl, }; /// Pointer to the common data shared by all declarations of this - /// template. - mutable CommonBase *Common = nullptr; + /// template, and a flag indicating if the template is a member + //

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-08-26 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @cor3ntin What's the deadline? https://github.com/llvm/llvm-project/pull/104458 ___ 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 lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-08-26 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > Can you please add more details in your summary about the problem and how the > PR will fix the problem. @shafik I will once I get back to this PR. > @sdkrystian do you plan to add more tests? @cor3ntin I do, I just haven't gotten around to it yet :) https://github.com/llvm

[clang] [Clang][Sema] Rebuild template parameters for out-of-line template definitions and partial specializations (PR #104030)

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

[clang] [Clang][Sema] Rebuild template parameters for out-of-line template definitions and partial specializations (PR #104030)

2024-08-22 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/104030 >From 14db4ba124a36ea778515fe0228ae959081f6d65 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 14 Aug 2024 09:00:30 -0400 Subject: [PATCH 1/3] [Clang][Sema] Rebuild template parameters for out-o

[clang] [libcxx] Reapply "[Clang] Implement resolution for CWG1835 (#92957, #98547)" (PR #100425)

2024-08-19 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @cor3ntin This wouldn't fix [the case that abseil users complained about](https://github.com/llvm/llvm-project/pull/98547#issuecomment-2224998395) (example reduced from [the source](https://github.com/abseil/abseil-cpp/blob/master/absl/container/internal/compressed_tuple.h#L2

[clang] [libcxx] Reapply "[Clang] Implement resolution for CWG1835 (#92957, #98547)" (PR #100425)

2024-08-19 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: CWG reviewed [CWG2920](https://cplusplus.github.io/CWG/issues/2920.html) during the 08-16 teleconference: > The resolution for [issue > 1835](https://cplusplus.github.io/CWG/issues/1835.html) in P1787 has > addressed real concerns. CWG recognizes that real-world code now no l

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-08-15 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/104458 >From 9f4fb3fb8df6d0981723ce9b8da809d9f2284348 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 15 Aug 2024 11:27:34 -0400 Subject: [PATCH 1/2] [Clang][Sema] Use the correct lookup context when

[clang] [Clang][Sema] Use the correct lookup context when building overloaded 'operator->' in the current instantiation (PR #104458)

2024-08-15 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/104458 Fixes #104268. Still need tests. >From 9f4fb3fb8df6d0981723ce9b8da809d9f2284348 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 15 Aug 2024 11:27:34 -0400 Subject: [PATCH] [Clang][Sema] Use the

[clang] [Clang][Sema] Rebuild template parameters for out-of-line template definitions and partial specializations (PR #104030)

2024-08-14 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/104030 We need to rebuild the template parameters of out-of-line definitions/specializations of member templates in the context of the current instantiation for the purposes of declaration matching. We already do t

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

2024-08-12 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: I don't think this is the right approach. What I think we _should_ be doing is to compare the operands of the _noexcept-specifier_ the same way we compare constraints (i.e. substitute so all references to template parameters have the correct depth and _then_ check whether the

[clang] [Clang][AST][NFC] Store template parameter position for TemplateTypeParmType in TypeBit (PR #102481)

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

[clang] [Clang][AST][NFC] Store template parameter position for TemplateTypeParmType in TypeBit (PR #102481)

2024-08-08 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @mizvekov [llvm-compile-time-tracker](https://llvm-compile-time-tracker.com/compare.php?from=3e3ea54aada44212b4e273f2fc879a419dea053f&to=77585f02c39d182e6aef60856ec6816d28ce0888&stat=instructions:u) reports a 0.07% improvement in userspace instruction retired. Not bad :). htt

[clang] [Clang][AST][NFC] Store template parameter position for TemplateTypeParmType in TypeBit (PR #102481)

2024-08-08 Thread Krystian Stasiowski via cfe-commits
@@ -6131,52 +6149,30 @@ class BTFTagAttributedType : public Type, public llvm::FoldingSetNode { class TemplateTypeParmType : public Type, public llvm::FoldingSetNode { friend class ASTContext; // ASTContext creates these - // Helper data collector for canonical types. - s

[clang] [Clang][AST][NFC] Store template parameter position for TemplateTypeParmType in TypeBit (PR #102481)

2024-08-08 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > LGTM > > Are there any performance numbers worth mentioning? I haven't checked... I'll check with llvm-compile-time-tracker. https://github.com/llvm/llvm-project/pull/102481 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][AST][NFC] Store template parameter position for TemplateTypeParmType in TypeBit (PR #102481)

2024-08-08 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/102481 `TemplateTypeParmType` currently stores the depth, index, and whether a template type parameter is a pack in a union of `CanonicalTTPTInfo` and `TemplateTypeParmDecl*`, and only the canonical type stores the

[clang] [Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (PR #100392)

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

[clang] [Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (PR #100392)

2024-08-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/100392 >From 2721a3142f4cf7e22eec27f8c209a2a4e8f98519 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 24 Jul 2024 10:15:47 -0400 Subject: [PATCH 1/3] [Clang][Sema] Make UnresolvedLookupExprs in class s

[clang] [Clang][Sema] Ensure that the selected candidate for a member function explicit specialization is more constrained than all others (PR #101721)

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

[clang] [Clang][Sema] Ensure that the selected candidate for a member function explicit specialization is more constrained than all others (PR #101721)

2024-08-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/101721 >From dd1c7b5fe3e1c4bca73cc5b4162ae73c3d7783fb Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 2 Aug 2024 11:32:49 -0400 Subject: [PATCH 1/5] [Clang][Sema] Ensure that the selected candidate for

[clang] [Clang][Sema] Ensure that the selected candidate for a member function explicit specialization is more constrained than all others (PR #101721)

2024-08-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/101721 >From 046bf3e993cd8905869cb244ddb7df019b44ae78 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 2 Aug 2024 11:32:49 -0400 Subject: [PATCH 1/5] [Clang][Sema] Ensure that the selected candidate for

[clang] [Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (PR #100392)

2024-08-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/100392 >From 7d0e70feb5e657c1830901e3ed9a01c1d56c7526 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 24 Jul 2024 10:15:47 -0400 Subject: [PATCH 1/3] [Clang][Sema] Make UnresolvedLookupExprs in class s

[clang] [Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (PR #100392)

2024-08-05 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/100392 >From 7d0e70feb5e657c1830901e3ed9a01c1d56c7526 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 24 Jul 2024 10:15:47 -0400 Subject: [PATCH] [Clang][Sema] Make UnresolvedLookupExprs in class scope

[clang] [Clang][NFC] Remove trailing whitespace from SemaExpr.cpp (PR #102001)

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

[clang] [Clang][NFC] Remove trailing whitespace from SemaExpr.cpp (PR #102001)

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

[clang] [Clang][NFC] Remove trailing whitespace from SemaExpr.cpp (PR #102001)

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

[clang] [Clang][NFC] Remove trailing whitespace from SemaExpr.cpp (PR #102001)

2024-08-05 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/102001 None >From 42012dba14c04b00ea0c8f542a9bfc0983002a9e Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 5 Aug 2024 11:03:04 -0400 Subject: [PATCH] [Clang][NFC] Remove trailing whitespace from SemaE

[clang] [Clang][Sema] Make UnresolvedLookupExprs in class scope explicit specializations instantiation dependent (PR #100392)

2024-08-05 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > Can we get rid of the whitespace only changes? @cor3ntin I have my editor configured to remove trailing whitespace on save. I'll just merge a commit to `main` that removes the trailing whitespace. > Can we maybe introduce an enum, it's a lot of booleans that will be easy to

[clang] [Clang][Sema] Ensure that the selected candidate for a member function explicit specialization is more constrained than all others (PR #101721)

2024-08-05 Thread Krystian Stasiowski via cfe-commits
@@ -10465,7 +10466,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, Previous)) NewFD->setInvalidDecl(); } -} else if (isMemberSpecialization && isa(NewFD)) { +} else if (isMembe

[clang] [Clang][Sema] Ensure that the selected candidate for a member function explicit specialization is more constrained than all others (PR #101721)

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

[clang] [Clang][Sema] Ensure that the selected candidate for a member function explicit specialization is more constrained than all others (PR #101721)

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

[clang] [Clang][Sema] Ensure that the selected candidate for a member function explicit specialization is more constrained than all others (PR #101721)

2024-08-05 Thread Krystian Stasiowski via cfe-commits
@@ -7964,8 +7964,9 @@ NamedDecl *Sema::ActOnVariableDeclarator( D.setRedeclaration(CheckVariableDeclaration(NewVD, Previous)); } else { // If this is an explicit specialization of a static data member, check it. -if (IsMemberSpecialization && !IsVariableTemplateSp

[clang] [libcxx] Reapply "[Clang] Implement resolution for CWG1835 (#92957, #98547)" (PR #100425)

2024-08-01 Thread Krystian Stasiowski via cfe-commits
@@ -1779,6 +1779,42 @@ void Parser::checkPotentialAngleBracket(ExprResult &PotentialTemplateName) { Priority); } +bool Parser::isMissingTemplateKeywordBeforeScope(bool AnnotateInvalid) { + assert(Tok.is(tok::coloncolon)); + Sema::DisableTypoCorrectionRAI

[clang] [libcxx] Reapply "[Clang] Implement resolution for CWG1835 (#92957, #98547)" (PR #100425)

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

[clang] [libcxx] Reapply "[Clang] Implement resolution for CWG1835 (#92957, #98547)" (PR #100425)

2024-07-31 Thread Krystian Stasiowski via cfe-commits
@@ -1779,6 +1779,42 @@ void Parser::checkPotentialAngleBracket(ExprResult &PotentialTemplateName) { Priority); } +bool Parser::isMissingTemplateKeywordBeforeScope(bool AnnotateInvalid) { + assert(Tok.is(tok::coloncolon)); + Sema::DisableTypoCorrectionRAI

  1   2   3   4   5   6   7   8   9   >