[clang] [HLSL] Add a warning for implicit bindings (PR #135909)

Justin Bogner via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 16 13:28:09 PDT 2025


================
@@ -3278,6 +3284,9 @@ void SemaHLSL::processExplicitBindingsOnDecl(VarDecl *VD) {
           << static_cast<int>(RT);
     }
   }
+
+  if (!HasBinding && VD->getType()->isHLSLResourceRecord())
----------------
bogner wrote:

Good catch! Added some tests with arrays and updated this to use `isResourceRecordTypeOrArrayOf`

Note: I pulled in the overload of this function from #135120 to simplify things slightly and avoid churn later.

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


More information about the cfe-commits mailing list