[clang] [HLSL] Add testing for space parameter on global constants (PR #106782)

Damyan Pepper via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 30 12:32:01 PDT 2024


================
@@ -817,8 +821,12 @@ static void DiagnoseHLSLRegisterAttribute(Sema &S, SourceLocation &ArgLoc,
       S.Diag(TheDecl->getLocation(),
              diag::warn_hlsl_user_defined_type_missing_member)
           << regTypeNum;
-
-    return;
+    // non-zero SpaceNum cannot be specified for global constants
----------------
damyanp wrote:

This is validating that the space must be exactly `"0"`, whereas the rule that DXC implements is that you can't have any kind of space directive.

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


More information about the cfe-commits mailing list