[clang] [Clang] include attribute scope in diagnostics (PR #144619)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 1 13:15:33 PDT 2025


================
@@ -506,7 +506,15 @@ void clang::FormatASTNodeDiagnosticArgument(
     case DiagnosticsEngine::ak_attr: {
       const Attr *At = reinterpret_cast<Attr *>(Val);
       assert(At && "Received null Attr object!");
-      OS << '\'' << At->getSpelling() << '\'';
+
+      OS << '\'';
+      if (At->hasScope()) {
----------------
AaronBallman wrote:

> Some custom attributes don’t explicitly set a name from the parsed attribute - for example:

That seems like a bug? Does this come up often?

I suppose it doesn't much matter for this PR, the operator is still needed for today. Thanks!



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


More information about the cfe-commits mailing list