Skip to content

Commit 73c8af5

Browse files
committed
self-review: update skip logic to account for context
1 parent 4908ecf commit 73c8af5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

clang/lib/Parse/ParseDeclCXX.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5246,9 +5246,8 @@ void Parser::ParseMicrosoftRootSignatureAttributeArgs(ParsedAttributes &Attrs) {
52465246
if (!StrLiteral.has_value()) {
52475247
Diag(Tok, diag::err_expected_string_literal)
52485248
<< /*in attributes...*/ 4 << RootSignatureIdent->getName();
5249-
SkipUntil(tok::r_square, StopAtSemi | StopBeforeMatch);
5250-
if (Tok.is(tok::r_paren))
5251-
T.consumeClose();
5249+
SkipUntil(tok::r_paren, StopAtSemi | StopBeforeMatch);
5250+
T.consumeClose();
52525251
return;
52535252
}
52545253

@@ -5270,9 +5269,7 @@ void Parser::ParseMicrosoftRootSignatureAttributeArgs(ParsedAttributes &Attrs) {
52705269
SmallVector<llvm::hlsl::rootsig::RootElement> Elements;
52715270
hlsl::RootSignatureParser Parser(Elements, Lexer, PP);
52725271
if (Parser.parse()) {
5273-
SkipUntil(tok::r_square, StopAtSemi | StopBeforeMatch);
5274-
if (Tok.is(tok::r_paren))
5275-
T.consumeClose();
5272+
T.consumeClose();
52765273
return;
52775274
}
52785275

0 commit comments

Comments
 (0)