-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[clang] remove ClassScopeFunctionSpecializationDecl #66636
Conversation
@erichkeane Opinions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess my first question is 'why'? My second is 'if this is unnecessary, why was it here in the first place?`. I'd like some level of historical analysis here/perhaps the knowledge of @zygoloid.
Per the comment you mentioned, it is redundant. Switching to
being diagnosed prior to instantiation. Class scope explicit specializations currently exist in their own broken little corner of the frontend, so unifying their representation in the AST would be the first step towards properly fixing them.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly minor fixes and or questions.
2b5e53b
to
01ad064
Compare
Ping @erichkeane & @shafik -- I left comments responding to your feedback |
I don't have any comments, though someone with knowledge of teh clang-tools-extra stuff would be nice to take a look, as well as someone familiar with the serialization. @AaronBallman . ALSO, this might need a release note and does this need to be mailed to the 'breaking changes' vendor list since it is significantly going to change the AST? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
I will address that once this gets merged |
CC @llvm/clang-vendors for awareness of the AST changing to remove a node. |
Updated the release notes. I didn't go into exhaustive detail, but I can add more if anyone here deems it necessary @erichkeane @AaronBallman |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM aside from a minor suggestion with the release note.
Do you need someone to land these changes on your behalf? |
@AaronBallman I don't have write access, so that would be appreciated 🙂. I was putting off rebasing incase there were more responses to my comments, but I presume that there won't be so I will get it rebased now |
3b55a38
to
cc76b72
Compare
cc76b72
to
4ea4e89
Compare
✅ With the latest revision this PR passed the C/C++ code formatter. |
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. |
4ea4e89
to
39744e6
Compare
This removes the
ClassScopeFunctionSpecializationDecl
Decl
node, and instead usesDependentFunctionTemplateSpecializationInfo
to handle such declarations.DependentFunctionTemplateSpecializationInfo
is also changed to store aconst ASTTemplateArgumentListInfo*
to be more in line withFunctionTemplateSpecializationInfo
.This also changes
FunctionDecl::isFunctionTemplateSpecialization
to returntrue
for dependent specializations, andFunctionDecl::getTemplateSpecializationKind
/FunctionDecl::getTemplateSpecializationKindForInstantiation
to returnTSK_ExplicitSpecialization
for non-friend dependent specializations (the same behavior as dependent class scopeClassTemplateSepcializationDecl
&VarTemplateSepcializationDecl
).