Skip to content

Commit 17ac24c

Browse files
committed
[HLSL][RootSignature] Output stringified punctuator in diagnostics
1 parent 5a194c1 commit 17ac24c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

clang/include/clang/Lex/LexHLSLRootSignature.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ operator<<(const DiagnosticBuilder &DB, const RootSignatureToken::Kind Kind) {
5050
case RootSignatureToken::Kind::X: \
5151
DB << SPELLING; \
5252
break;
53+
#define PUNCTUATOR(X, SPELLING) \
54+
case RootSignatureToken::Kind::pu_##X: \
55+
DB << #SPELLING; \
56+
break;
5357
#include "clang/Lex/HLSLRootSignatureTokenKinds.def"
5458
}
5559
return DB;

clang/test/SemaHLSL/RootSignature-err.hlsl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ void bad_root_signature_3() {}
1818

1919
[RootSignature("DescriptorTable(), invalid")] // expected-error {{expected end of stream to denote end of parameters, or, another valid parameter of RootSignature}}
2020
void bad_root_signature_4() {}
21+
22+
// expected-error@+1 {{expected ')' to denote end of parameters, or, another valid parameter of RootConstants}}
23+
[RootSignature("RootConstants(b0, num32BitConstants = 1, invalid)")]
24+
void bad_root_signature_5() {}

0 commit comments

Comments
 (0)