================ @@ -795,6 +796,9 @@ static void DiagnoseHLSLRegisterAttribute(Sema &S, SourceLocation &ArgLoc, S.Diag(ArgLoc, diag::warn_hlsl_deprecated_register_type_b); else if (regType != RegisterType::C) S.Diag(ArgLoc, diag::err_hlsl_binding_type_mismatch) << regTypeNum; + // Space argument cannot be specified for global constants + if (AL.getNumArgs() == 2) + S.Diag(ArgLoc, diag::err_hlsl_space_on_global_constant); ---------------- damyanp wrote:
Rather than checking for this diagnostic in two places, if you add this just before the call to `ValidateMultipleRegisterAnnotations` then the tests still pass: ```c++ // Space argument cannot be specified for global constants if ((Flags.DefaultGlobals || Flags.UDT) && AL.getNumArgs() == 2) { S.Diag(ArgLoc, diag::err_hlsl_space_on_global_constant); return; } ``` https://github.com/llvm/llvm-project/pull/106782 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits