[clang] [clang-tools-extra] [Clang][Sema] Diagnose current instantiation used as an incomplete base class (PR #92597)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92597 >From 4a535c2f2660583487018f421788cd2b88d8428d Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 17 May 2024 13:30:04 -0400 Subject: [PATCH 1/8] [Clang][Sema] Diagnose current instantiation used a

[clang] [Clang][Sema] Don't build CXXDependentScopeMemberExprs for potentially implicit class member access expressions (PR #92318)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92318 >From 298b2fec54595e5c3c99070cbe856a36e1b71c95 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 15 May 2024 16:13:03 -0400 Subject: [PATCH 1/5] [Clang][Sema] Don't build CXXDependentScopeMemberExp

[clang] [Clang][Sema] Fix crash when diagnosing near-match for 'constexpr' redeclaration in C++11 (PR #92452)

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

[clang] [Clang][Sema] Do not add implicit 'const' when matching constexpr function template explicit specializations after C++14 (PR #92449)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92449 >From 0e73c984a4215207b2842f60ac4dcaeb63230407 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 15:47:04 -0400 Subject: [PATCH 1/2] [Clang][Sema] Do not add implicit 'const' when match

[clang] [Clang][Sema] Don't build CXXDependentScopeMemberExprs for potentially implicit class member access expressions (PR #92318)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92318 >From 72f0013122b764c7295a9b80b1f886b2eb38fb1d Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 15 May 2024 16:13:03 -0400 Subject: [PATCH 1/5] [Clang][Sema] Don't build CXXDependentScopeMemberExp

[clang] [Clang][Sema] Don't build CXXDependentScopeMemberExprs for potentially implicit class member access expressions (PR #92318)

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

[clang] [clang-tools-extra] [Clang][Sema] Diagnose current instantiation used as an incomplete base class (PR #92597)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92597 >From 697004547e8855787e7dd248508c9453b9df7e4d Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 17 May 2024 13:30:04 -0400 Subject: [PATCH 1/8] [Clang][Sema] Diagnose current instantiation used a

[clang] [Clang] Properly set the value category of dependent unary operators (PR #88740)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Ping @cor3ntin ^ https://github.com/llvm/llvm-project/pull/88740 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [Clang][Sema] Diagnose current instantiation used as an incomplete base class (PR #92597)

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

[clang] [Clang][Sema] Do not add implicit 'const' when matching constexpr function template explicit specializations after C++14 (PR #92449)

2024-05-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92449 >From f1a55b4f341990df2dc6edd740801486ca43488a Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 16 May 2024 15:47:04 -0400 Subject: [PATCH 1/2] [Clang][Sema] Do not add implicit 'const' when match

[clang] [Clang][Sema] Do not add implicit 'const' when matching constexpr function template explicit specializations after C++14 (PR #92449)

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

[clang] [Clang] Implement resolution for CWG1835 (PR #92957)

2024-05-21 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/92957 [CWG1835](https://cplusplus.github.io/CWG/issues/1835.html) was one of the many core issues resolved by [P1787R6: Declarations and where to find them](http://wg21.link/p1787r6). Its resolution changes how [me

[clang] [Clang] Implement resolution for CWG1835 (PR #92957)

2024-05-21 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: (this PR is by no means complete, but I would like feedback regarding the validity of my interpretation of the DR resolution and perhaps some guidance with how to best go about implementing it. The currently included implementation _works_, but I'm uncertain whether it's the

[clang] [Clang] Implement resolution for CWG1835 (PR #92957)

2024-05-21 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/92957 >From 4524db5ae7f3133b51328fbabd1f6188d7d3707b Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 21 May 2024 13:15:24 -0400 Subject: [PATCH 1/2] [WIP][Clang] Implement resolution for CWG1835 ---

[clang] [Clang] Implement resolution for CWG1835 (PR #92957)

2024-05-21 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @Endilll I'm still in the process of writing tests, but I'll add several soon. I'm quite confident about my interpretation being correct but I just want to be 100% sure :). At the very least this patch gets [[basic.lookup.qual.general] example 3](http://eel.is/c++draft/basi

[clang] [clang] Distinguish unresolved templates in UnresolvedLookupExpr (PR #89019)

2024-05-22 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @zyn0217 Yes, both examples are of uninstantiable templates & are intended to be diagnosed by #90152. https://github.com/llvm/llvm-project/pull/89019 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

[clang] [Clang] Implement resolution for CWG1835 (PR #92957)

2024-05-22 Thread Krystian Stasiowski via cfe-commits
@@ -55,15 +55,21 @@ namespace PR11856 { template T *end(T*); - class X { }; + struct X { }; + struct Y { +int end; + }; template void Foo2() { T it1; -if (it1->end < it1->end) { -} +if (it1->end < it1->end) { } X *x; -if (x->end <

[clang] [clang-tools-extra] [Clang] Unify interface for accessing template arguments as written for class/variable template specializations (PR #81642)

2024-05-27 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @kimgr The linked code seems to only be concerned with the `SourceLocation` of the `Decl` (which should be the same `SourceLocation` returned by `Decl::getLocation`), and the template arguments as written (which can be accessed via `getTemplateArgsAsWritten` per this patch).

[clang] [Clang] Only non-overloaded dereference expressions are lvalues (PR #93457)

2024-05-27 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/93457 ___ 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-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] [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] [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
@@ -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] 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][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][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][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][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] 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] 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 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] 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] 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][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][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
@@ -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: @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
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] [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] [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] [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] [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] 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][Parse] Fix ambiguity with nested-name-specifiers that may declarative (PR #96364)

2024-06-21 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/96364 Consider the following: ```cpp template struct A { }; template int A::B::* f(); // error: no member named 'B' in 'A' ``` Although this is clearly valid, clang rejects it because the _nested-name-specifier_ `

[clang] [Clang][Parse] Fix ambiguity with nested-name-specifiers that may declarative (PR #96364)

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

[clang] Clang: Add warning flag for storage class specifiers on explicit specializations (PR #96699)

2024-06-26 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian approved this pull request. Minor nit: Probably don't need to explicitly define a diagnostic group, since it's only ever used for this diagnostic. https://github.com/llvm/llvm-project/pull/96699 ___ cfe-commits mailing l

[clang] [Clang][Sema] Fix lookup of dependent operator= named by using-declaration (PR #91503)

2024-06-28 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @pawosm-arm Could you provide some examples? Barring an issue with `operator=` which has been addressed, builds should only fail in the presence of accesses to non-existent members. Addressing such issues is the responsibility of users. https://github.com/llvm/llvm-project/p

[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] 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
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] 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 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] [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] 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] 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] 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 "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
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] 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: @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: @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: 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] 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] [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, #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)" (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
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
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] [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] 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] 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-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] [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-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] 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 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
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] 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/4] [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] 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] 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-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] 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] 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] [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] [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][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] [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
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] 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
@@ -51,14 +51,15 @@ DefaultTemplateArgumentContainsUnexpandedPack(const TemplateParam &P) { P.getDefaultArgument().getArgument().containsUnexpandedParameterPack(); } -TemplateParameterList::TemplateParameterList(const ASTContext& C, +TemplateParameterList::TemplateP

<    4   5   6   7   8   9   10   >