[clang] [Clang][Sema] Differentiate between partial/explicit specializations when diagnosing unexpanded packs (PR #72015)

2023-11-10 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/72015 None >From 394e2e0eed84f0102d194174a7c60048556c56dc Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 10 Nov 2023 20:51:12 -0500 Subject: [PATCH] [Clang] Differentiate between partial/explicit sp

[clang] [Clang][Sema] Differentiate between partial/explicit specializations when diagnosing unexpanded packs (PR #72015)

2023-11-13 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/72015 >From 3667d7646db255890d7e29209581e5b12909bd90 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 10 Nov 2023 20:51:12 -0500 Subject: [PATCH] [Clang] Differentiate between partial/explicit speciali

[clang] [Clang][Sema] Differentiate between partial/explicit specializations when diagnosing unexpanded packs (PR #72015)

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

[clang] [Clang][Sema] Differentiate between partial/explicit specializations when diagnosing unexpanded packs (PR #72015)

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

[clang] [Clang][Sema] Differentiate between partial/explicit specializations when diagnosing unexpanded packs (PR #72015)

2023-11-13 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Ping @erichkeane https://github.com/llvm/llvm-project/pull/72015 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Differentiate between partial/explicit specializations when diagnosing unexpanded packs (PR #72015)

2023-11-13 Thread Krystian Stasiowski via cfe-commits
@@ -369,9 +369,39 @@ void test_unexpanded_exprs(Types ...values) { void f(int arg = values); // expected-error{{default argument contains unexpanded parameter pack 'values'}} } -// Test unexpanded parameter packs in partial specializations. -template -struct TestUnexpandedD

[clang] [Clang][Sema] Differentiate between partial/explicit specializations when diagnosing unexpanded packs (PR #72015)

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

[clang] [Clang][Sema] Diagnose friend function specialization definitions (PR #72863)

2023-12-11 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/72863 >From 7b26c6ea5f3c75f1146df21f51c1f40967aaae98 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 20 Nov 2023 07:11:41 -0500 Subject: [PATCH] [Clang][Sema] Diagnose friend function specialization d

[clang] [Clang][Sema] Diagnose friend function specialization definitions (PR #72863)

2023-12-11 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane Rebased and squashed. Will need you (or someone else with write access) to merge. https://github.com/llvm/llvm-project/pull/72863 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[clang] [Clang][Sema] Differentiate between partial/explicit specializations when diagnosing unexpanded packs (PR #72015)

2023-11-16 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane Unless you would like someone else to review this, could you please merge this when you have time? I don't have write access 🙂 https://github.com/llvm/llvm-project/pull/72015 ___ cfe-commits mailing list cfe-commits@lists

[clang] [Clang][Sema] Diagnose friend function specialization definitions (PR #72863)

2023-11-20 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/72863 Per [[class.friend]p6](http://eel.is/c++draft/class.friend#6) a friend function shall not be defined if its name isn't unqualified. A _template-id_ is not a name, meaning that a friend function specialization

[clang] [Clang][Sema] Diagnose friend function specialization definitions (PR #72863)

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

[clang] [Clang][Sema] Diagnose friend function specialization definitions (PR #72863)

2023-11-20 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Ping @AaronBallman @erichkeane https://github.com/llvm/llvm-project/pull/72863 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][Sema] Diagnose friend function specialization definitions (PR #72863)

2023-11-27 Thread Krystian Stasiowski via cfe-commits
@@ -4,7 +4,8 @@ void f(T); template struct A { - // expected-error@+1{{cannot declare an explicit specialization in a friend}} + // expected-error@+2{{cannot declare an explicit specialization in a friend}} + // expected-error@+1{{friend function specialization cannot be de

[clang] [Clang][Sema] Diagnose friend function specialization definitions (PR #72863)

2023-11-27 Thread Krystian Stasiowski via cfe-commits
@@ -373,6 +373,7 @@ template void foo() {} // expected-note{{candidate ignored: not a memb } using ns::foo; template struct A { + // expected-error@+1{{friend function specialization cannot be defined}} sdkrystian wrote: Per my other comment, I think the r

[clang] [Clang][Sema] Diagnose friend function specialization definitions (PR #72863)

2023-11-27 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane the most recent commit results in the following: ```cpp template void f(T); void g() { } template struct A { // error: cannot declare an explicit specialization in a friend template<> friend void f<>(T) { } // error: friend function specialization cannot be de

[clang] [Clang][Sema] Diagnose friend function specialization definitions (PR #72863)

2023-11-27 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/72863 >From 3e191f245325742338eba223a3f98b6bb5ad414b Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 20 Nov 2023 07:11:41 -0500 Subject: [PATCH 1/2] [Clang][Sema] Diagnose friend function specializatio

[clang] [Clang][Sema] Diagnose friend function specialization definitions (PR #72863)

2023-11-27 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/72863 >From 3e191f245325742338eba223a3f98b6bb5ad414b Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 20 Nov 2023 07:11:41 -0500 Subject: [PATCH 1/2] [Clang][Sema] Diagnose friend function specializatio

[clang] [Clang][Sema] Diagnose friend function specialization definitions (PR #72863)

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

[clang] [Clang][Sema] Diagnose unexpanded packs in the template argument lists of function template specializations (PR #76677)

2024-01-01 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/76677 This diagnoses unexpanded packs in the _unqualified-id_ of a function template specialization's _declarator-id_, e.g.: ```cpp template struct A { template void f(); template<> void f(); // err

[clang] [Clang][Sema] Diagnose unexpanded packs in the template argument lists of function template specializations (PR #76677)

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

[clang] [Clang][Sema] Diagnose unexpanded packs in the template argument lists of function template specializations (PR #76677)

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

[clang] [Clang][Sema] Diagnose unexpanded packs in the template argument lists of function template specializations (PR #76677)

2024-01-03 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/76677 >From f034044ad94d6f7ccec13d89f08acac257ed28bb Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 1 Jan 2024 07:35:09 -0500 Subject: [PATCH] [Clang][Sema] Diagnose unexpanded packs in the template

[clang] [Clang][Sema] Diagnose unexpanded packs in the template argument lists of function template specializations (PR #76677)

2024-01-03 Thread Krystian Stasiowski via cfe-commits
@@ -518,6 +518,7 @@ Improvements to Clang's diagnostics - Clang now diagnoses definitions of friend function specializations, e.g. ``friend void f<>(int) {}``. - Clang now diagnoses narrowing conversions involving const references. (`#63151:

[clang] [Clang][Sema] Diagnose unexpanded packs in the template argument lists of function template specializations (PR #76677)

2024-01-03 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Added release note & rebased. I'll need someone to merge this for me :) https://github.com/llvm/llvm-project/pull/76677 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang-tools-extra] [clang-doc] Fix failing test (PR #76857)

2024-01-03 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/76857 This fixes a failing test case in clang-doc introduced by 7fbc1de9896029636dd572a692ee90ba88285943. I presume the test is intended to be well-formed, so I have changed it accordingly. >From 7b7c9b78bc48a0df

[clang-tools-extra] [clang-doc] Fix failing test (PR #76857)

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

[clang-tools-extra] [clang-doc] Fix failing test (PR #76857)

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

[clang] [clang-tools-extra] Reapply "[Clang][Sema] Diagnose unexpanded packs in the template argument lists of function template specializations" (#76876) (PR #76915)

2024-01-03 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/76915 This reapplies f034044ad94d6f7ccec13d89f08acac257ed28bb after it was reverted by 687396b5f4ba0713d103ebd172b308e92eb930cc due to a test failure in clang-doc. The test in question declares a partial specializa

[clang] [clang-tools-extra] Reapply "[Clang][Sema] Diagnose unexpanded packs in the template argument lists of function template specializations" (#76876) (PR #76915)

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

[clang] [clang-tools-extra] Reapply "[Clang][Sema] Diagnose unexpanded packs in the template argument lists of function template specializations" (#76876) (PR #76915)

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

[clang-tools-extra] [clang] Reapply "[Clang][Sema] Diagnose unexpanded packs in the template argument lists of function template specializations" (#76876) (PR #76915)

2024-01-04 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @cor3ntin @erichkeane if either of you could merge that that would be appreciated :) https://github.com/llvm/llvm-project/pull/76915 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang] [Clang][NFC] Fix out-of-bounds access (PR #77193)

2024-01-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/77193 The changes to tablegen made by https://github.com/llvm/llvm-project/pull/76825 result in `StmtClass::lastStmtConstant` changing from `StmtClass::WhileStmtClass` to `StmtClass::GCCAsmStmtClass`. Since `CFG::

[clang] [Clang][NFC] Fix out-of-bounds access (PR #77193)

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

[clang] [Clang][NFC] Fix out-of-bounds access (PR #77193)

2024-01-08 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/77193 >From b737ce548ad554bc351820cedd693b9f8737be45 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Sat, 6 Jan 2024 07:26:06 -0500 Subject: [PATCH] [Clang][NFC] Fix out-of-bounds access --- clang/include

[clang] [Clang][NFC] Fix out-of-bounds access (PR #77193)

2024-01-08 Thread Krystian Stasiowski via cfe-commits
@@ -1215,7 +1215,7 @@ class CFG { //======// class BuildOptions { -std::bitset alwaysAddMask; sdkrystian wrote: @ymand Fair enough, I added one. https://github.com/llvm/llvm-project

[clang] [Clang][NFC] Fix out-of-bounds access (PR #77193)

2024-01-08 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @qedawkins Ah, I should have clarified... I will need someone with write access to merge this :) https://github.com/llvm/llvm-project/pull/77193 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

[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] 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] 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 ac

[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. https://github.com/llvm/llvm-pro

[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 _nested-

[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 `co

[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][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 &Tok) { +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 &Tok) { +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> &NextToken) { +return NextToken.ends_with(StringRef("char")) || sdkrystian wrote: Don't really understand what this is for... https://github.com/llvm/llvm-pro

[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 &Tok) { +if (isEnd()) + return false; +Position SavedPos = Pos; +consumeWhitespace(); +SmallString<32> NextToken; +SmallString<32

[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-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 ex

[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 fun

[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-28 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 1/3] [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-29 Thread Krystian Stasiowski via cfe-commits
@@ -12107,6 +12090,35 @@ bool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, CheckConstPureAttributesUsage(*this, NewFD); + // C++23 [dcl.spec.auto.general]p12: + // Return type deduction for a templated function with a placeholder in its + // declare

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

2024-03-29 Thread Krystian Stasiowski via cfe-commits
@@ -345,6 +345,10 @@ Bug Fixes in This Version - Fixes an assertion failure on invalid code when trying to define member functions in lambdas. +- Clang now allows for member function templates of class templates declared with a deduced return type + to be explicitly specia

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

2024-03-29 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 1/4] [Clang][Sema] Fix explicit specializations of member

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

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

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

2024-04-01 Thread Krystian Stasiowski via cfe-commits
@@ -1735,48 +1757,21 @@ MemberExpr *MemberExpr::Create( ValueDecl *MemberDecl, DeclAccessPair FoundDecl, DeclarationNameInfo NameInfo, const TemplateArgumentListInfo *TemplateArgs, QualType T, ExprValueKind VK, ExprObjectKind OK, NonOdrUseReason NOUR) { - bool HasQ

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

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

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

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

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

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

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

2024-04-01 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane Regarding "Still waiting on this?", I pushed a commit that addresses the fixme. I'll be addressing the rest of your review comments in a subsequent commit.. Also, if we are renaming `ExplicitInstantiationInfo::ExternLoc` to `ExternKeywordLoc`, should we rename th

[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-04-01 Thread Krystian Stasiowski via cfe-commits
@@ -1287,7 +1287,10 @@ static ExprResult LookupMemberExpr(Sema &S, LookupResult &R, return ExprError(); QualType BaseType = BaseExpr.get()->getType(); + +#if 0 sdkrystian wrote: This assertion should be deleted since the lookup context could be the cur

[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-04-01 Thread Krystian Stasiowski via cfe-commits
@@ -990,6 +970,18 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType, const Scope *S, bool SuppressQualifierCheck, ActOnMemberAccessExtraArgs *ExtraArgs) { + asse

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

2024-04-01 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Ping @erichkeane 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-04-02 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/86817 >From e84e4b6fedb5a643082cd38d0e10d910b299f73f 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 fun

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

2024-04-02 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed 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][AST][NFC] MemberExpr stores NestedNameSpecifierLoc and DeclAccessPair separately (PR #86678)

2024-04-02 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/86678 >From d257fa46da4f84dfcedfa8d25267f3326996d72e Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 26 Mar 2024 10:04:44 -0400 Subject: [PATCH] [Clang][AST][NFC] MemberExpr stores NestedNameSpecifierL

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

2024-04-02 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/86682 >From d257fa46da4f84dfcedfa8d25267f3326996d72e Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 26 Mar 2024 10:04:44 -0400 Subject: [PATCH 1/2] [Clang][AST][NFC] MemberExpr stores NestedNameSpeci

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

2024-04-02 Thread Krystian Stasiowski via cfe-commits
@@ -583,11 +583,14 @@ class alignas(void *) Stmt { unsigned IsArrow : 1; /// True if this member expression used a nested-name-specifier to -/// refer to the member, e.g., "x->Base::f", or found its member via -/// a using declaration. When true, a MemberExprN

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

2024-04-02 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane Requested changes applied... should I wait for other reviews on the other PR (#86678), or do you think I should go ahead and merge #86678 and then this one? https://github.com/llvm/llvm-project/pull/86682 ___ cfe-commits

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

2024-04-02 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane Just merging this PR will result in the commits being squashed into a single commit... is that alright? https://github.com/llvm/llvm-project/pull/86682 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

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

2024-04-02 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Thanks! I'll add a comment on the other PR saying the commit was reviewed here & then I'll merge https://github.com/llvm/llvm-project/pull/86682 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/m

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

2024-04-02 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Changes were reviewed in the review of #86682 https://github.com/llvm/llvm-project/pull/86678 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

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

2024-04-02 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/86682 >From 125b91778874e9f61e178ea4dd2efaf592ea84bb Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 26 Mar 2024 11:27:28 -0400 Subject: [PATCH] [Clang][AST][NFC] Move template argument dependence com

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

2024-04-02 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian closed https://github.com/llvm/llvm-project/pull/86682 ___ 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-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/80842 According to [[expr.prim.id.qual] p3](http://eel.is/c++draft/expr.prim.id.qual#3): > The _nested-name-specifier_ `​:`:​ nominates the global namespace. A > _nested-name-specifier_ with a _computed-type-specif

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

2024-02-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited 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-06 Thread Krystian Stasiowski via cfe-commits
@@ -6295,22 +6297,36 @@ bool Sema::diagnoseQualifiedDeclaration(CXXScopeSpec &SS, DeclContext *DC, << FixItHint::CreateRemoval(TemplateId->TemplateKWLoc); NestedNameSpecifierLoc SpecLoc(SS.getScopeRep(), SS.location_data()); - while (SpecLoc.getPrefix()) { + do {

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

2024-02-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/80842 >From 75734c9cf5c9467130fdc08efa64eb624e659879 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 nested-name-specifiers

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

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

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

2024-02-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/80842 >From 13abf4ca1003f4cc04926881ce74c5f4818a761c 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 nested-name-specifiers

[clang] [Clang][Sema] Abbreviated function templates do not append invented parameters to empty template parameter lists (PR #80864)

2024-02-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/80864 According to [[dcl.fct] p23](http://eel.is/c++draft/dcl.fct#23): > An abbreviated function template can have a _template-head_. The invented > _template-parameters_ are appended to the _template-parameter-list

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

2024-02-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/80842 >From c7457d759a93a04c3243c036e1c31296c8e81ec4 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 nested-name-specifiers

[clang] [Clang][Sema] Abbreviated function templates do not append invented parameters to empty template parameter lists (PR #80864)

2024-02-06 Thread Krystian Stasiowski via cfe-commits
@@ -9759,7 +9759,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, SmallVector TemplateParamLists; llvm::append_range(TemplateParamLists, TemplateParamListsRef); if (TemplateParameterList *Invented = D.getInventedTemplateParameterList()) { -

[clang] [Clang][Sema] Abbreviated function templates do not append invented parameters to empty template parameter lists (PR #80864)

2024-02-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/80864 >From 570e25f19b428fb7d2936091726727f9633eec35 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 6 Feb 2024 11:08:04 -0500 Subject: [PATCH 1/2] [Clang][Sema] Abbreviated function templates do not

[clang] [Clang][Sema] Abbreviated function templates do not append invented parameters to empty template parameter lists (PR #80864)

2024-02-06 Thread Krystian Stasiowski via cfe-commits
@@ -9759,7 +9759,7 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator &D, DeclContext *DC, SmallVector TemplateParamLists; llvm::append_range(TemplateParamLists, TemplateParamListsRef); if (TemplateParameterList *Invented = D.getInventedTemplateParameterList()) { -

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

2024-02-06 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: Ping @Endilll @erichkeane 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-06 Thread Krystian Stasiowski via cfe-commits
@@ -145,6 +145,7 @@ Improvements to Clang's diagnostics prints. - Clang now diagnoses member template declarations with multiple declarators. +- Clang now diagnoses friend declarations with an ``enum`` elaborated-type-specifier outside of C++98. sdkrystian

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

2024-02-06 Thread Krystian Stasiowski via cfe-commits
@@ -380,7 +375,8 @@ class DeclSpec { unsigned FS_noreturn_specified : 1; // friend-specifier - unsigned Friend_specified : 1; + unsigned FriendSpecified : 1; sdkrystian wrote: `LLVM_PREFERRED_TYPE` I believe https://github.com/llvm/llvm-project/pull/80

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

2024-02-06 Thread Krystian Stasiowski via cfe-commits
@@ -145,6 +145,7 @@ Improvements to Clang's diagnostics prints. - Clang now diagnoses member template declarations with multiple declarators. +- Clang now diagnoses friend declarations with an ``enum`` elaborated-type-specifier outside of C++98. sdkrystian

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

2024-02-06 Thread Krystian Stasiowski via cfe-commits
@@ -1637,10 +1637,8 @@ def err_inline_namespace_std : Error< def err_unexpected_friend : Error< "friends can only be classes or functions">; def ext_enum_friend : ExtWarn< - "befriending enumeration type %0 is a C++11 extension">, InGroup; -def warn_cxx98_compat_enum_friend

[clang] [Clang][Sema] Implement proposed resolution for CWG2847 (PR #80899)

2024-02-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/80899 Per the approved resolution for [CWG2847](https://cplusplus.github.io/CWG/issues/2847.html), [temp.expl.spec] p8 will state: > An explicit specialization shall not have a trailing _requires-clause_ unless >

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

2024-02-06 Thread Krystian Stasiowski via cfe-commits
@@ -1637,10 +1637,8 @@ def err_inline_namespace_std : Error< def err_unexpected_friend : Error< "friends can only be classes or functions">; def ext_enum_friend : ExtWarn< - "befriending enumeration type %0 is a C++11 extension">, InGroup; -def warn_cxx98_compat_enum_friend

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

2024-02-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian edited 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-06 Thread Krystian Stasiowski via cfe-commits
@@ -252,4 +252,14 @@ namespace dr2397 { // dr2397: 17 auto (*c)[5] = &a; } } // namespace dr2397 + +// CWG2363 was closed as NAD, but its resolution does affirm that +// a friend declaration cannot have an opaque-enumm-specifier. +namespace dr2363 { // dr2363: yes +struct

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

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

[clang] [Clang][Sema] Implement proposed resolution for CWG2847 (PR #80899)

2024-02-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/80899 >From f9079ac4098b2debf3df4ebee3e5f4f0c2b1e6a2 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Tue, 6 Feb 2024 14:22:37 -0500 Subject: [PATCH 1/2] [Clang][Sema] Implement proposed resolution for CWG28

[clang] [Clang][Sema] Implement proposed resolution for CWG2847 (PR #80899)

2024-02-06 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @Endilll I applied your suggested changes... how does it look? https://github.com/llvm/llvm-project/pull/80899 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  1   2   3   4   5   6   7   8   9   10   >