[clang] [HLSL] Split out resource class data from resource attribute (PR #98419)
Joshua Batista via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 11 12:46:30 PDT 2024
================
@@ -7,7 +7,7 @@ struct [[hlsl::resource_class()]] Eg1 {
Eg1 e1;
-// expected-error at +1{{invalid resource class 'gibberish' used; expected 'SRV', 'UAV', 'CBuffer', or 'Sampler'}}
+// expected-warning at +1{{ResourceClass attribute argument not supported: gibberish}}
----------------
bob80905 wrote:
The attribute never gets added, so yes, it is accurate to view this warning as a declaration that the attribute is ignored. This is the exact same behavior as attaching an HLSL Shader attribute with an invalid argument.
If something requires the attribute to be present, an error would be emitted, but if there is no such requirement, I think compilation could succeed.
https://github.com/llvm/llvm-project/pull/98419
More information about the cfe-commits
mailing list