[clang] [clang-tools-extra] [Clang][Sema] Fix explicit specializations of member function templates with a deduced return type (PR #86817)

2024-03-27 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Still needs a release note but should otherwise be good to go https://github.com/llvm/llvm-project/pull/86817 ___ 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] Fix explicit specializations of member function templates with a deduced return type (PR #86817)

2024-03-27 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/86817 >From 468e3d9414a797ea73411a779343dee351e09e42 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 27 Mar 2024 11:23:19 -0400 Subject: [PATCH] [Clang][Sema] Fix explicit specializations of member

[clang] [clang-tools-extra] [Clang][Sema] Fix explicit specializations of member function templates with a deduced return type (PR #86817)

2024-03-27 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/86817 Currently, clang erroneously rejects the following: ```cpp template struct A { template auto f(); }; template<> template auto A::f(); // error: conflicting types for 'f' ``` This happens because the

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-03-27 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Ping @erichkeane https://github.com/llvm/llvm-project/pull/84050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Comments] Add argument parsing for @throw @throws @exception (PR #84726)

2024-03-27 Thread Krystian Stasiowski via cfe-commits
@@ -149,6 +276,93 @@ class TextTokenRetokenizer { addToken(); } + /// Extract a type argument + bool lexType(Token ) { +if (isEnd()) + return false; +Position SavedPos = Pos; +consumeWhitespace(); +SmallString<32> NextToken; +SmallString<32>

[clang] [Clang][Comments] Add argument parsing for @throw @throws @exception (PR #84726)

2024-03-27 Thread Krystian Stasiowski via cfe-commits
@@ -89,6 +108,114 @@ class TextTokenRetokenizer { } } + bool continueInt(SmallString<32> ) { +return NextToken.ends_with(StringRef("char")) || sdkrystian wrote: Don't really understand what this is for...

[clang] [Clang][Comments] Add argument parsing for @throw @throws @exception (PR #84726)

2024-03-27 Thread Krystian Stasiowski via cfe-commits
@@ -149,6 +276,93 @@ class TextTokenRetokenizer { addToken(); } + /// Extract a type argument + bool lexType(Token ) { +if (isEnd()) + return false; +Position SavedPos = Pos; +consumeWhitespace(); +SmallString<32> NextToken; +SmallString<32>

[clang] [Clang][Comments] Add argument parsing for @throw @throws @exception (PR #84726)

2024-03-27 Thread Krystian Stasiowski via cfe-commits
@@ -149,6 +276,93 @@ class TextTokenRetokenizer { addToken(); } + /// Extract a type argument + bool lexType(Token ) { +if (isEnd()) + return false; +Position SavedPos = Pos; +consumeWhitespace(); +SmallString<32> NextToken; +SmallString<32>

[clang] [Clang][Comments] Add argument parsing for @throw @throws @exception (PR #84726)

2024-03-27 Thread Krystian Stasiowski via cfe-commits
@@ -75,6 +75,25 @@ class TextTokenRetokenizer { return *Pos.BufferPtr; } + char peekNext(unsigned offset) const { +assert(!isEnd()); +assert(Pos.BufferPtr != Pos.BufferEnd); +if (Pos.BufferPtr + offset <= Pos.BufferEnd) { sdkrystian wrote:

[clang] [Clang][AST][NFC] Move template argument dependence computations for MemberExpr to computeDependence (PR #86682)

2024-03-26 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/86682 (This patch depends on #86678) Pretty straightforward change, addresses the FIXME's in `computeDependence(MemberExpr*)` and `MemberExpr::Create` by moving the template argument dependence computations to

[clang] [Clang][AST][NFC] MemberExpr stores NestedNameSpecifierLoc and DeclAccessPair separately (PR #86678)

2024-03-26 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/86678 Currently, `MemberExpr` allocates a trailing `MemberExprNameQualifier` object if it either has a `NestedNameSpecifierLoc`, or if it names a member found via using declaration. Since the presence of a

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-03-19 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane This PR is in a more "ready" state now, if you'd like to take another look. The added overload of `LookupTemplateName` which has no `MemberOfUnknownSpecialization` parameter it more of an experimental change... it can be ignored.

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-03-18 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/84050 >From 67d9b107a1e5dde52769f6e7d9dc41b1d777cb60 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 1 Mar 2024 08:08:52 -0500 Subject: [PATCH 01/14] [Clang][Sema] Earlier resolution of class member

[clang] [clang][Sema] Track trivial-relocatability as a type trait (PR #84621)

2024-03-15 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian commented: Minor nit, but otherwise looks good. https://github.com/llvm/llvm-project/pull/84621 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema] Track trivial-relocatability as a type trait (PR #84621)

2024-03-15 Thread Krystian Stasiowski via cfe-commits
@@ -826,6 +842,14 @@ void CXXRecordDecl::addedMember(Decl *D) { ? !Constructor->isImplicit() : (Constructor->isUserProvided() || Constructor->isExplicit())) data().Aggregate = false; + + // A trivially relocatable class is a class: +

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-11 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: So, it seems that this crash occurs because we filter out all non-template functions, which will trigger ADL if the only class member we found was a non-template function. https://github.com/llvm/llvm-project/pull/83842 ___

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-11 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @wlei-llvm Thank you! I've reduced the repro to this: ```cpp struct A { }; template void f(A); struct B { void f(); void g() { f(A()); } }; ``` https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list

[clang] [Clang][Comments] Add argument parsing for @throw @throws @exception (PR #84726)

2024-03-11 Thread Krystian Stasiowski via cfe-commits
@@ -149,6 +191,76 @@ class TextTokenRetokenizer { addToken(); } + /// Extract a type argument + bool lexDataType(Token ) { +if (isEnd()) + return false; +Position SavedPos = Pos; +consumeWhitespace(); +SmallString<32> NextToken; +

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-08 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @bgra8 Reverted. Any sort of repro would be appreciated :) https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (#83842)" (PR #84457)

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

[clang] Revert "[Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (#83842)" (PR #84457)

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

[clang] Revert "[Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (#83842)" (PR #84457)

2024-03-08 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/84457 This reverts commit a642eb89bdaf10c6b4994fc1187de27b441236ed. >From 02f98e180b94bec0c6abafeaaf8a7513f5116eab Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 8 Mar 2024 05:44:48 -0500 Subject:

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-07 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @wlei-llvm Not a known issue... could you provide a repro? I'll look into this in the meantime. https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-03-07 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/84050 >From f5ed116971fd90608b84578fdb61761924d65c98 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 1 Mar 2024 08:08:52 -0500 Subject: [PATCH 1/8] [Clang][Sema] Earlier resolution of class member

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

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

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-03-05 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/84050 >From 1495e87d7cbbab6a824d9d1d2bf53d0ef9ec9125 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 1 Mar 2024 08:08:52 -0500 Subject: [PATCH 1/7] [Clang][Sema] Earlier resolution of class member

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

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

[clang] [Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent base classes (PR #84050)

2024-03-05 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/84050 Consider the following: ```cpp template struct A { auto f() { return this->x; } }; ``` Although `A` has no dependent base classes and the lookup context for `x` is the current

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

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

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-05 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83842 >From 4725321631e69c8d8480e0dba85128d177541a89 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 4 Mar 2024 08:10:35 -0500 Subject: [PATCH 1/5] [Clang][Sema] Fix crash when using name of

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-05 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83842 >From 4725321631e69c8d8480e0dba85128d177541a89 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 4 Mar 2024 08:10:35 -0500 Subject: [PATCH 1/4] [Clang][Sema] Fix crash when using name of

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-05 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83842 >From 4725321631e69c8d8480e0dba85128d177541a89 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 4 Mar 2024 08:10:35 -0500 Subject: [PATCH 1/3] [Clang][Sema] Fix crash when using name of

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83842 >From aeeb445a9e52a8011a008a5ee3438709f835034c Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 4 Mar 2024 08:10:35 -0500 Subject: [PATCH 1/3] [Clang][Sema] Fix crash when using name of

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

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

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83842 >From aeeb445a9e52a8011a008a5ee3438709f835034c Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 4 Mar 2024 08:10:35 -0500 Subject: [PATCH 1/2] [Clang][Sema] Fix crash when using name of

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Updated with new fix https://github.com/llvm/llvm-project/pull/83842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83842 >From aeeb445a9e52a8011a008a5ee3438709f835034c Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 4 Mar 2024 08:10:35 -0500 Subject: [PATCH 1/2] [Clang][Sema] Fix crash when using name of

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83842 >From aeeb445a9e52a8011a008a5ee3438709f835034c Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 4 Mar 2024 08:10:35 -0500 Subject: [PATCH 1/2] [Clang][Sema] Fix crash when using name of

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Actually, I don't think the proposed fix here is quite right. If we _only_ find an `UnresolvedUsingValueDecl`, then we shouldn't assume the name is a template per [[temp.names] p3.3](http://eel.is/c++draft/temp.names#3.3)... will work on a new fix.

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

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

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

2024-03-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/79683 >From 7d05842505dbcabcc54cb365006c794ab9371983 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 16 Jan 2024 08:05:33 -0500 Subject: [PATCH] Reapply "[Clang][Sema] Diagnose function/variable

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

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

[clang] [Clang][Sema] Fix crash when using name of UnresolvedUsingValueDecl with template arguments (PR #83842)

2024-03-04 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/83842 The following snippet causes a crash ([godbolt link](https://godbolt.org/z/E17sYfYrY)): ```cpp template struct A : T { using T::f; void f(); void g() { f(); // crash here } }; ``` This happens

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

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

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: > Side note: In the future can you be more descriptive with follow up commit > messages, isntead of just `[FOLD]`. That doesn't really tell me whether I > need to re-review/give context, particularly since I do much of that triage > in email. Apologies -- I'll keep this in

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83024 >From 1c57410ebef490ae96b0f087426b44ce6ae37f72 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 26 Feb 2024 11:03:06 -0500 Subject: [PATCH 1/3] [Clang][Sema] Fix crash when MS dependent base

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83024 >From 1c57410ebef490ae96b0f087426b44ce6ae37f72 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 26 Feb 2024 11:03:06 -0500 Subject: [PATCH 1/3] [Clang][Sema] Fix crash when MS dependent base

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Krystian Stasiowski via cfe-commits
@@ -283,6 +283,7 @@ Bug Fixes to C++ Support (`#78524 `_) - Clang no longer instantiates the exception specification of discarded candidate function templates when determining the primary template of an explicit

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83024 >From 1c57410ebef490ae96b0f087426b44ce6ae37f72 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 26 Feb 2024 11:03:06 -0500 Subject: [PATCH 1/2] [Clang][Sema] Fix crash when MS dependent base

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Krystian Stasiowski via cfe-commits
@@ -283,6 +283,7 @@ Bug Fixes to C++ Support (`#78524 `_) - Clang no longer instantiates the exception specification of discarded candidate function templates when determining the primary template of an explicit

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane Added a release note. I don't believe there is an open issue (I did a cursory search), found this "in the wild". https://github.com/llvm/llvm-project/pull/83024 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/83024 >From 1c57410ebef490ae96b0f087426b44ce6ae37f72 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 26 Feb 2024 11:03:06 -0500 Subject: [PATCH] [Clang][Sema] Fix crash when MS dependent base class

[clang] [Clang][Sema] Fix crash when MS dependent base class lookup occurs in an incomplete context (PR #83024)

2024-02-26 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/83024 When compiling the following with `-fms-compatibility`: ```cpp template struct C; // Test lookup with incomplete lookup context template auto C::f() -> decltype(x) { } ``` An assert fails because

[clang] [Clang][Sema] Defer instantiation of exception specification until after partial ordering when determining primary template (PR #82417)

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

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

2024-02-26 Thread Krystian Stasiowski via cfe-commits
@@ -885,16 +885,19 @@ bool Sema::DiagnoseUninstantiableTemplate(SourceLocation PointOfInstantiation, /// that the template parameter 'PrevDecl' is being shadowed by a new /// declaration at location Loc. Returns true to indicate that this is /// an error, and false otherwise.

[clang] [Clang][Sema] Defer instantiation of exception specification until after partial ordering when determining primary template (PR #82417)

2024-02-26 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Also added a couple more tests since the diagnostics currently depend on whether instantiation occurs. https://github.com/llvm/llvm-project/pull/82417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Defer instantiation of exception specification until after partial ordering when determining primary template (PR #82417)

2024-02-26 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/82417 >From 06fe8f513866684b70b044524eba9ece9d2701c0 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 20 Feb 2024 14:03:50 -0500 Subject: [PATCH] [Clang][Sema] Defer instantiation of exception

[clang] [Clang][Sema] Defer instantiation of exception specification until after partial ordering when determining primary template (PR #82417)

2024-02-26 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane Added release note, relevant standardese quote, and some exposition. https://github.com/llvm/llvm-project/pull/82417 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Defer instantiation of exception specification until after partial ordering when determining primary template (PR #82417)

2024-02-26 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/82417 >From e669903ec50ef0fb1297f150e3a4eb6837db1b53 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 20 Feb 2024 14:03:50 -0500 Subject: [PATCH] [Clang][Sema] Defer instantiation of exception

[clang] [Clang][Sema] Defer instantiation of exception specification until after partial ordering when determining primary template (PR #82417)

2024-02-26 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/82417 >From 3966e98d9eb6c04faf8a7fd0c4de804964437595 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 20 Feb 2024 14:03:50 -0500 Subject: [PATCH] [Clang][Sema] Defer instantiation of exception

[clang] [Clang][Sema] Defer instantiation of exception specification until after partial ordering when determining primary template (PR #82417)

2024-02-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/82417 >From 16b6ce3b1895c15ce896c5e8dcbe29ee1274d38b Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 20 Feb 2024 14:03:50 -0500 Subject: [PATCH] [Clang][Sema] Defer instantiation of exception

[clang] [Clang][Sema] Defer instantiation of exception specification until after partial ordering when determining primary template (PR #82417)

2024-02-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/82417 Consider the following: ```cpp struct A { static constexpr bool x = true; }; template void f(T, U) noexcept(T::y); // #1, error: no member named 'y' in 'A' template void f(T, U*) noexcept(T::x); // #2

[clang] [Clang][Sema] Diagnose declarative nested-name-specifiers naming alias templates (PR #80842)

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

[clang] [Clang][Sema] Diagnose declarative nested-name-specifiers naming alias templates (PR #80842)

2024-02-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/80842 >From 3cef590557625cffcfa97f226271027111adc1d0 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 6 Feb 2024 09:14:42 -0500 Subject: [PATCH] [Clang][Sema] Diagnose declarative

[clang] [Clang][Sema] Convert warning for extraneous template parameter lists to an extension warning (PR #82277)

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

[clang] [Clang][Sema] Convert warning for extraneous template parameter lists to an extension warning (PR #82277)

2024-02-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/82277 >From 0ba458f15e29e4fda7a4bc36d836f018bcc05f66 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 19 Feb 2024 15:36:10 -0500 Subject: [PATCH] [Clang][Sema] Convert warning for extraneous template

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

2024-02-20 Thread Krystian Stasiowski via cfe-commits
@@ -885,16 +885,19 @@ bool Sema::DiagnoseUninstantiableTemplate(SourceLocation PointOfInstantiation, /// that the template parameter 'PrevDecl' is being shadowed by a new /// declaration at location Loc. Returns true to indicate that this is /// an error, and false otherwise.

[clang] [Clang][Sema] Diagnose declarative nested-name-specifiers naming alias templates (PR #80842)

2024-02-20 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane Should i wait for additional reviews, or can this be merged? https://github.com/llvm/llvm-project/pull/80842 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [Clang][Sema] Convert warning for extraneous template parameter lists to an extension warning (PR #82277)

2024-02-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/82277 >From c31ab160b6fb1fb765a885ab3f553437c5768d28 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 19 Feb 2024 15:36:10 -0500 Subject: [PATCH 1/3] [Clang][Sema] Convert warning for extraneous

[clang] [Clang][Sema] Convert warning for extraneous template parameter lists to an extension warning (PR #82277)

2024-02-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/82277 >From c31ab160b6fb1fb765a885ab3f553437c5768d28 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 19 Feb 2024 15:36:10 -0500 Subject: [PATCH 1/2] [Clang][Sema] Convert warning for extraneous

[clang] [Clang][Sema] Convert warning for extraneous template parameter lists to an extension warning (PR #82277)

2024-02-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/82277 >From c7521b9ad5d86d5817060e777b0da60e2aa96871 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 19 Feb 2024 15:36:10 -0500 Subject: [PATCH 1/2] [Clang][Sema] Convert warning for extraneous

[clang] [Clang][Sema] Convert warning for extraneous template parameter lists to an extension warning (PR #82277)

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

[clang] [Clang][Sema] Convert warning for extraneous template parameter lists to an extension warning (PR #82277)

2024-02-19 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/82277 We currently accept the following explicit specialization with a warning for the extraneous template parameter list: ```cpp template void f(); template<> template<> void f(); // warning: extraneous template

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

2024-02-19 Thread Krystian Stasiowski via cfe-commits
@@ -1792,23 +1807,11 @@ class ClassTemplateSpecializationDecl llvm::PointerUnion SpecializedTemplate; - /// Further info for explicit template specialization/instantiation. - struct ExplicitSpecializationInfo { -/// The type-as-written. -TypeSourceInfo

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

2024-02-15 Thread Krystian Stasiowski via cfe-commits
@@ -885,16 +885,19 @@ bool Sema::DiagnoseUninstantiableTemplate(SourceLocation PointOfInstantiation, /// that the template parameter 'PrevDecl' is being shadowed by a new /// declaration at location Loc. Returns true to indicate that this is /// an error, and false otherwise.

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

2024-02-15 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/79683 >From 0d4a6d155b5d70970b63f4337507098ea938f627 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 16 Jan 2024 08:05:33 -0500 Subject: [PATCH] Reapply "[Clang][Sema] Diagnose function/variable

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

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

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

2024-02-15 Thread Krystian Stasiowski via cfe-commits
@@ -885,16 +885,19 @@ bool Sema::DiagnoseUninstantiableTemplate(SourceLocation PointOfInstantiation, /// that the template parameter 'PrevDecl' is being shadowed by a new /// declaration at location Loc. Returns true to indicate that this is /// an error, and false otherwise.

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

2024-02-15 Thread Krystian Stasiowski via cfe-commits
@@ -2545,10 +2545,12 @@ ASTDeclReader::VisitClassTemplateSpecializationDeclImpl( } // Explicit info. - if (TypeSourceInfo *TyInfo = readTypeSourceInfo()) { -auto *ExplicitInfo = -new (C) ClassTemplateSpecializationDecl::ExplicitSpecializationInfo; -

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

2024-02-14 Thread Krystian Stasiowski via cfe-commits
@@ -6316,6 +6310,15 @@ TEST(HasAnyTemplateArgumentLoc, BindsToSpecializationWithDoubleArgument) { hasTypeLoc(loc(asString("double"))); } +TEST(HasAnyTemplateArgumentLoc, BindsToExplicitSpecializationWithIntArgument) { + EXPECT_TRUE( +

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

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

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

2024-02-14 Thread Krystian Stasiowski via cfe-commits
@@ -285,30 +285,23 @@ template<> class SpecializationDecl; // CHECK: [[@LINE-1]]:7 | class(Gen,TS)/C++ | SpecializationDecl | c:@S@SpecializationDecl>#I | | Decl,RelSpecialization | rel: 1 // CHECK-NEXT: RelSpecialization | SpecializationDecl | c:@ST>1#T@SpecializationDecl

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

2024-02-14 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/81642 >From 0834af0d1fcd2a87656fabdb7b0aee0f42b9b52f Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 9 Feb 2024 14:00:49 -0500 Subject: [PATCH 1/3] [Clang] Unify interface for accessing template

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

2024-02-14 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/81642 >From 0834af0d1fcd2a87656fabdb7b0aee0f42b9b52f Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 9 Feb 2024 14:00:49 -0500 Subject: [PATCH 1/2] [Clang] Unify interface for accessing template

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

2024-02-13 Thread Krystian Stasiowski via cfe-commits
@@ -285,30 +285,23 @@ template<> class SpecializationDecl; // CHECK: [[@LINE-1]]:7 | class(Gen,TS)/C++ | SpecializationDecl | c:@S@SpecializationDecl>#I | | Decl,RelSpecialization | rel: 1 // CHECK-NEXT: RelSpecialization | SpecializationDecl | c:@ST>1#T@SpecializationDecl

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

2024-02-13 Thread Krystian Stasiowski via cfe-commits
@@ -279,7 +279,7 @@ namespace dr727 { // dr727: partial // cxx98-11-error@-1 {{variable templates are a C++14 extension}} // cxx98-14-error@-2 {{inline variables are a C++17 extension}} template<> static inline int v2; // #dr727-v2-T -// cxx98-14-error@-1

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

2024-02-13 Thread Krystian Stasiowski via cfe-commits
@@ -222,7 +220,7 @@ int binTempl; template float binTempl = 1; -// CHECK: VarTemplatePartialSpecializationDecl 0x{{[^ ]*}} col:7 binTempl 'float' cinit sdkrystian wrote: I removed `cinit` because the output will contain "`explicit_specialization`"

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

2024-02-13 Thread Krystian Stasiowski via cfe-commits
@@ -2596,23 +2582,24 @@ class VarTemplateSpecializationDecl : public VarDecl, llvm::PointerUnion SpecializedTemplate; - /// Further info for explicit template specialization/instantiation. - struct ExplicitSpecializationInfo { -/// The type-as-written. -

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

2024-02-13 Thread Krystian Stasiowski via cfe-commits
@@ -1985,44 +1986,45 @@ class ClassTemplateSpecializationDecl SpecializedTemplate = TemplDecl; } - /// Sets the type of this specialization as it was written by - /// the user. This will be a class template specialization type. - void setTypeAsWritten(TypeSourceInfo

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

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

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-13 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/80171 >From 5de10ae0864dacf5f48daf476a4fa20177545d9b Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 31 Jan 2024 11:09:11 -0500 Subject: [PATCH] [Clang][Sema] Diagnose friend declarations with enum

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

2024-02-13 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/81642 Our current method of storing the template arguments as written for `(Class/Var)Template(Partial)SpecializationDecl` suffers from a number of flaws: - We use `TypeSourceInfo` to store `TemplateArgumentLocs`

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-12 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Ping @erichkeane @cor3ntin https://github.com/llvm/llvm-project/pull/80171 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Diagnose declarative nested-name-specifiers naming alias templates (PR #80842)

2024-02-12 Thread Krystian Stasiowski via cfe-commits
@@ -6295,22 +6297,36 @@ bool Sema::diagnoseQualifiedDeclaration(CXXScopeSpec , DeclContext *DC, << FixItHint::CreateRemoval(TemplateId->TemplateKWLoc); NestedNameSpecifierLoc SpecLoc(SS.getScopeRep(), SS.location_data()); - while (SpecLoc.getPrefix()) { + do {

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

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

[clang] [Clang][Sema] Diagnose friend declarations with enum elaborated-type-specifier in all language modes (PR #80171)

2024-02-08 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/80171 >From 921ee093c7366210a8e8587baab6f5d26ae506c3 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 31 Jan 2024 11:09:11 -0500 Subject: [PATCH] [Clang][Sema] Diagnose friend declarations with enum

[clang-tools-extra] [clang-tidy] Fix failing test after #80864 (PR #81171)

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

[clang-tools-extra] [clang-tidy] Fix failing test after #80864 (PR #81171)

2024-02-08 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane I'm building the check-clang-extra target locally just to make sure that the test passes... should be done in ~5 mins https://github.com/llvm/llvm-project/pull/81171 ___ cfe-commits mailing list

[clang-tools-extra] [clang-tidy] Fix failing test after #80864 (PR #81171)

2024-02-08 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/81171 >From ca871fca01e07bd1dcbdab3256cb1631dabca853 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 8 Feb 2024 13:42:38 -0500 Subject: [PATCH] [clang-tidy] Fix failing test after

[clang-tools-extra] [clang-tidy] Fix failing test after #80864 (PR #81171)

2024-02-08 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited https://github.com/llvm/llvm-project/pull/81171 ___ 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   >