================
@@ -345,25 +347,26 @@ class DiagnoseHLSLAvailability
 
   // Helper methods for dealing with current stage context / environment
   void SetShaderStageContext(HLSLShaderAttr::ShaderType ShaderType) {
+    static_assert(HLSLShaderAttr::ShaderTypeMaxValue < 31,
+                  "ShaderType is too big for this bitmap");
     assert((((unsigned)1) << (unsigned)ShaderType) != 0 &&
+           (((unsigned)1) << (unsigned)ShaderType) != 31 &&
----------------
damyanp wrote:

`1 << ` any number can't ever be 31 can it?

Maybe it's meant to be something like:

```suggestion
    assert((((unsigned)1) << (unsigned)ShaderType) != 0 &&
           (unsigned)ShaderType) != 31 &&
```



https://github.com/llvm/llvm-project/pull/92704
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to