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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 3 04:19:38 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:

I'd say let's tackle that one separately. I've not investigated, but unless that call to `::Create` from HLSL is in reaction to the user writing that attribute in the source themselves, that should be using `::CreateImplicit` instead because it's compiler-generated code.

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


More information about the cfe-commits mailing list