[clang] [Clang] add fix-it hints for unknown attributes (PR #141305)

Oleksandr T. via cfe-commits cfe-commits at lists.llvm.org
Wed May 28 14:23:26 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();
----------------
a-tarasyuk wrote:

> BUT this requires us to act separately on the scope so we cna do some sort of validation/fixit.

To proceed, I think the starting point should be to track whether the scope was explicitly written as part of a `using-prefix`. From what I understand, that might require introducing something like `attrs groups` — or is there a more suitable approach? 






https://github.com/llvm/llvm-project/pull/141305


More information about the cfe-commits mailing list