================ @@ -1,5 +1,24 @@ // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o - -fsyntax-only %s -verify +// valid +cbuffer cbuf { + RWBuffer<int> r : register(u0, space0); +} + +cbuffer cbuf2 { + struct x { + // expected-error@+1 {{'register' attribute only applies to cbuffer/tbuffer and external global variables}} + RWBuffer<int> E : register(u2, space3); + }; +} ---------------- bob80905 wrote:
I thought to add this to show why the `!isDeclaredWithinCOrTBuffer` call is necessary. It prevents the second diagnostic about the space parameter from being emitted. I don't believe there is a case like this that uses the space parameter. 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