[clang] [Clang] Improve diagnostics to show the correct position for `[[maybe_unused]]` before a using-alias (PR #223910)
Alexsander Borges Damaceno via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 16 12:06:40 PDT 2026
================
@@ -740,7 +749,10 @@ Parser::DeclGroupPtrTy Parser::ParseUsingDeclaration(
return nullptr;
}
- ProhibitAttributes(PrefixAttrs);
+ SourceLocation MisplacedAttrFixItLoc;
+ if (PrefixAttrs.hasAttribute(ParsedAttr::AT_Unused))
+ MisplacedAttrFixItLoc = Tok.getLocation();
+ ProhibitAttributes(PrefixAttrs, MisplacedAttrFixItLoc);
----------------
AlexsanderDamaceno wrote:
ok, gonna change it, I had put that because I thought about only apply for the `maybe_unused`
https://github.com/llvm/llvm-project/pull/223910
More information about the cfe-commits
mailing list