[clang] [HLSL][RootSignature] Use "stringified" version for diagnostic output of punctuator tokens (PR #145827)
Finn Plummer via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 26 09:13:24 PDT 2025
================
@@ -18,3 +18,7 @@ void bad_root_signature_3() {}
[RootSignature("DescriptorTable(), invalid")] // expected-error {{expected end of stream to denote end of parameters, or, another valid parameter of RootSignature}}
void bad_root_signature_4() {}
+
+// expected-error at +1 {{expected ')' to denote end of parameters, or, another valid parameter of RootConstants}}
+[RootSignature("RootConstants(b0, num32BitConstants = 1, invalid)")]
----------------
inbelic wrote:
Thank you for the feedback, when you work with the code for months and write the diagnostic it is always makes sense to yourself.
Note: There is some missing info here, as it doesn't have where diagnostic is pointing in the source location.
In this case it would be pointing right after the comma, and the desired interpretation would be:
"after this comma it is expected that we should either have a ')' to denote the end of parameters or another valid parameter of RootConstants".
With that being said, I am very open to feedback and I can see the confusion!
I will create a todo to take another look at clarifying the diagnostic messages.
https://github.com/llvm/llvm-project/pull/145827
More information about the cfe-commits
mailing list