Skip to content

Commit b17b40c

Browse files
committed
audit use of err_expected_after
the order of the parameters is switched as opposed to either and this was not caught in the unit tests
1 parent 4edb7fa commit b17b40c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

clang/lib/Parse/ParseHLSLRootSignature.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1299,9 +1299,11 @@ bool RootSignatureParser::consumeExpectedToken(TokenKind Expected,
12991299
DB << Expected;
13001300
break;
13011301
case diag::err_expected_either:
1302-
case diag::err_expected_after:
13031302
DB << Expected << Context;
13041303
break;
1304+
case diag::err_expected_after:
1305+
DB << Context << Expected;
1306+
break;
13051307
default:
13061308
break;
13071309
}

clang/test/SemaHLSL/RootSignature-err.hlsl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,15 @@ void bad_root_signature_10() {}
5555
// expected-error@+1 {{invalid parameter of DescriptorTable}}
5656
[RootSignature("DescriptorTable(invalid))")]
5757
void bad_root_signature_11() {}
58+
59+
// expected-error@+1 {{expected integer literal after '+'}}
60+
[RootSignature("CBV(space = +invalid))")]
61+
void bad_root_signature_12() {}
62+
63+
// expected-error@+1 {{expected integer literal after '='}}
64+
[RootSignature("CBV(space = invalid))")]
65+
void bad_root_signature_13() {}
66+
67+
// expected-error@+1 {{expected '(' after UAV}}
68+
[RootSignature("UAV invalid")]
69+
void bad_root_signature_14() {}

0 commit comments

Comments
 (0)