[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed May 28 13:12:46 PDT 2025
================
@@ -7867,15 +7865,16 @@ void Sema::checkUnusedDeclAttributes(Declarator &D) {
void Sema::DiagnoseUnknownAttribute(const ParsedAttr &AL) {
std::string NormalizedFullName = '\'' + AL.getNormalizedFullName() + '\'';
+ SourceRange NR = AL.getNormalizedRange();
----------------
erichkeane wrote:
Re: `ParsedAttr`/vs `CommonInfo`: Ack, that makes sense.
Re fixit only with no scope: I think that is somewhat sensible. I think it is at least an improvement.
You're right that we'd have to some pretty sizable changes to represent the 'scope' via using to the AST, and I don't have a great idea how that should look. We'd either have to do a 'normalization' for the group to make our 'fixit' work (that is, we end up converting usings into explicits or vice versa?), OR represent them.
That said, we COULD fixit just the identifier where it is, right? Since we already know the scope and are correcting within the scope, we can't just change the current 'identifier' to what we're suggesting as a fixit? IF we limited it that way, it would 'inherit' whatever sort of scoping was already there perhaps?
https://github.com/llvm/llvm-project/pull/141305
More information about the cfe-commits
mailing list