[clang] Implement resource binding type prefix mismatch diagnostic infrastructure (PR #97103)

Damyan Pepper via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 22 16:02:10 PDT 2024


================
@@ -0,0 +1,76 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify
+
+// This test validates the diagnostics that are emitted when a variable with a "resource" type
+// is bound to a register using the register annotation
+
+// expected-error at +1  {{binding type 'b' only applies to constant buffer resources}}
+RWBuffer<int> a : register(b2, space1);
----------------
damyanp wrote:

I think that the ClassTemplateSpecializationDecl is going to become dead anyway once we put the attribute in the right place.  This is why I think we should set these up so that the attribute is in the correct place now rather than later because we're doing work now to exercise code that we know is going to almost immediately change.

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


More information about the cfe-commits mailing list