[clang] [HLSL][SPIRV] Add vk::constant_id attribute. (PR #143544)
Nathan Gauër via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 16 06:41:35 PDT 2025
================
@@ -12919,6 +12919,18 @@ def err_spirv_enum_not_int : Error<
def err_spirv_enum_not_valid : Error<
"invalid value for %select{storage class}0 argument">;
+def err_specialization_const_lit_init
+ : Error<"variable with 'vk::constant_id' attribute cannot have an "
+ "initializer that is not a literal">;
----------------
Keenuts wrote:
nit, more aligned with C++ errors about const init.
```suggestion
def err_specialization_const_lit_init
: Error<"variable with 'vk::constant_id' attribute must be initialized by a int/float/enum/bool literal.">;
```
nit nit: maybe this message could also be used to replace the 2 other messages: this way you have a full fix suggested instead of first "this is not initialized", then "now it's initialized but not a literal", and finally "this is a literal, but not a float/int/enum/bool".
https://github.com/llvm/llvm-project/pull/143544
More information about the cfe-commits
mailing list