[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-10-06 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/66636 >From 39744e6eb218ae519bcce83d90273296de496d94 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 25 Aug 2023 14:07:32 -0400 Subject: [PATCH] [clang] remove ClassScopeFunctionSpecializationDecl

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-10-06 Thread Erich Keane via cfe-commits
erichkeane wrote: If Aaron doesn't get to it, feel free to ping me on Monday. Its too late on a Friday for me to be able to merge this for you, but monday morning would be fine for me. https://github.com/llvm/llvm-project/pull/66636 ___ cfe-commits

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-10-06 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: Do you need someone to land these changes on your behalf? https://github.com/llvm/llvm-project/pull/66636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-10-03 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian updated https://github.com/llvm/llvm-project/pull/66636 >From d11d546f3190936ba45c57b4825073026d817878 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 25 Aug 2023 14:07:32 -0400 Subject: [PATCH 1/5] [clang] remove ClassScopeFunctionSpecializationDecl

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-10-02 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM aside from a minor suggestion with the release note. https://github.com/llvm/llvm-project/pull/66636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-10-02 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/66636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-10-02 Thread Aaron Ballman via cfe-commits
AaronBallman wrote: CC @llvm/clang-vendors for awareness of the AST changing to remove a node. https://github.com/llvm/llvm-project/pull/66636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-10-02 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @AaronBallman > Can you be sure to file an issue or add a test case + FIXME comment so we > don't lose track of the needed follow-up work, or are you planning to do that > work immediately after this lands? I will address that once this gets merged

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-10-02 Thread Krystian Stasiowski via cfe-commits
@@ -752,8 +745,6 @@ class CollectExtraHighlightings } if (auto *Args = D->getTemplateSpecializationArgsAsWritten()) H.addAngleBracketTokens(Args->getLAngleLoc(), Args->getRAngleLoc()); -if (auto *I = D->getDependentSpecializationInfo()) -

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-10-02 Thread Aaron Ballman via cfe-commits
@@ -10442,32 +10441,54 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator , DeclContext *DC, if (getLangOpts().CUDA && !isFunctionTemplateSpecialization) maybeAddCUDAHostDeviceAttrs(NewFD, Previous); -// If it's a friend (and only if it's a friend), it's

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-10-02 Thread Aaron Ballman via cfe-commits
@@ -752,8 +745,6 @@ class CollectExtraHighlightings } if (auto *Args = D->getTemplateSpecializationArgsAsWritten()) H.addAngleBracketTokens(Args->getLAngleLoc(), Args->getRAngleLoc()); -if (auto *I = D->getDependentSpecializationInfo()) -

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-10-02 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman commented: The changes should definitely have a release note so that downstreams can be aware of the changes. This isn't really a potentially breaking change, but we should alert clang-vendors in case a downstream actually cares.

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-10-02 Thread Aaron Ballman via cfe-commits
@@ -9354,13 +9353,14 @@ Sema::CheckDependentFunctionTemplateSpecialization(FunctionDecl *FD, } F.done(); + bool isFriend = FD->getFriendObjectKind() != Decl::FOK_None; AaronBallman wrote: ```suggestion bool IsFriend = FD->getFriendObjectKind() !=

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-21 Thread Krystian Stasiowski via cfe-commits
@@ -1016,21 +1003,20 @@ void ASTDeclReader::VisitFunctionDecl(FunctionDecl *FD) { } case FunctionDecl::TK_DependentFunctionTemplateSpecialization: { // Templates. -UnresolvedSet<8> TemplDecls; -unsigned NumTemplates = Record.readInt(); -while

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Krystian Stasiowski via cfe-commits
@@ -650,17 +642,16 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { DependentFunctionTemplateSpecializationInfo * DFTSInfo = D->getDependentSpecializationInfo(); -// Templates. -Record.push_back(DFTSInfo->getNumTemplates()); -for (int i=0, e =

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Shafik Yaghmour via cfe-commits
@@ -4086,7 +4073,7 @@ FunctionDecl *Sema::SubstSpaceshipAsEqualEqual(CXXRecordDecl *RD, Decl *R; if (auto *MD = dyn_cast(Spaceship)) { R = Instantiator.VisitCXXMethodDecl( -MD, nullptr, std::nullopt, +MD, nullptr, shafik wrote:

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Shafik Yaghmour via cfe-commits
@@ -650,17 +642,16 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { DependentFunctionTemplateSpecializationInfo * DFTSInfo = D->getDependentSpecializationInfo(); -// Templates. -Record.push_back(DFTSInfo->getNumTemplates()); -for (int i=0, e =

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Shafik Yaghmour via cfe-commits
https://github.com/shafik edited https://github.com/llvm/llvm-project/pull/66636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Krystian Stasiowski via cfe-commits
@@ -2154,6 +2144,15 @@ bool RecursiveASTVisitor::TraverseFunctionHelper(FunctionDecl *D) { TALI->NumTemplateArgs)); } } +// FIXME: Do we want to traverse the explicit template arguments for

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Krystian Stasiowski via cfe-commits
@@ -10442,32 +10441,54 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator , DeclContext *DC, if (getLangOpts().CUDA && !isFunctionTemplateSpecialization) maybeAddCUDAHostDeviceAttrs(NewFD, Previous); -// If it's a friend (and only if it's a friend), it's

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Erich Keane via cfe-commits
@@ -185,14 +185,11 @@ namespace SameSignatureAfterInstantiation { namespace PR22040 { template struct Foobar { -template <> void bazqux(typename T::type) {} // expected-error 2{{cannot be used prior to '::' because it has no members}} erichkeane

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: I didn't spend much time in Serialization, so hopefully someone else can take a look, but in general I think I'm warming toward this. https://github.com/llvm/llvm-project/pull/66636 ___ cfe-commits mailing

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Erich Keane via cfe-commits
@@ -2154,6 +2144,15 @@ bool RecursiveASTVisitor::TraverseFunctionHelper(FunctionDecl *D) { TALI->NumTemplateArgs)); } } +// FIXME: Do we want to traverse the explicit template arguments for

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Erich Keane via cfe-commits
@@ -428,6 +428,8 @@ class ASTNodeTraverser void VisitFunctionDecl(const FunctionDecl *D) { if (const auto *FTSI = D->getTemplateSpecializationInfo()) dumpTemplateArgumentList(*FTSI->TemplateArguments); +else if (const auto *DFTSI =

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Erich Keane via cfe-commits
@@ -10442,32 +10441,54 @@ Sema::ActOnFunctionDeclarator(Scope *S, Declarator , DeclContext *DC, if (getLangOpts().CUDA && !isFunctionTemplateSpecialization) maybeAddCUDAHostDeviceAttrs(NewFD, Previous); -// If it's a friend (and only if it's a friend), it's

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Krystian Stasiowski via cfe-commits
sdkrystian wrote: @erichkeane > I guess my first question is 'why'? Per the comment you mentioned, it is redundant. Switching to `DependentFunctionTemplateSpecializationInfo` also results in constructs such as: ``` template struct A { template<> void f(); }; ``` being diagnosed prior

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread via cfe-commits
cor3ntin wrote: @erichkeane Opinions? https://github.com/llvm/llvm-project/pull/66636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] remove ClassScopeFunctionSpecializationDecl (PR #66636)

2023-09-18 Thread Krystian Stasiowski via cfe-commits
https://github.com/sdkrystian created https://github.com/llvm/llvm-project/pull/66636 This removes the `ClassScopeFunctionSpecializationDecl` `Decl` node, and instead uses `DependentFunctionTemplateSpecializationInfo` to handle such declarations. `DependentFunctionTemplateSpecializationInfo`