Skip to content

Commit d42f270

Browse files
committed
self-review: update skip logic to account for context
1 parent 80609f4 commit d42f270

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
@@ -5348,9 +5348,8 @@ void Parser::ParseMicrosoftRootSignatureAttributeArgs(ParsedAttributes &Attrs) {
53485348
if (!StrLiteral.has_value()) {
53495349
Diag(Tok, diag::err_expected_string_literal)
53505350
<< /*in attributes...*/ 4 << RootSignatureIdent->getName();
5351-
SkipUntil(tok::r_square, StopAtSemi | StopBeforeMatch);
5352-
if (Tok.is(tok::r_paren))
5353-
T.consumeClose();
5351+
SkipUntil(tok::r_paren, StopAtSemi | StopBeforeMatch);
5352+
T.consumeClose();
53545353
return;
53555354
}
53565355

@@ -5372,9 +5371,7 @@ void Parser::ParseMicrosoftRootSignatureAttributeArgs(ParsedAttributes &Attrs) {
53725371
SmallVector<llvm::hlsl::rootsig::RootElement> Elements;
53735372
hlsl::RootSignatureParser Parser(Elements, Lexer, PP);
53745373
if (Parser.parse()) {
5375-
SkipUntil(tok::r_square, StopAtSemi | StopBeforeMatch);
5376-
if (Tok.is(tok::r_paren))
5377-
T.consumeClose();
5374+
T.consumeClose();
53785375
return;
53795376
}
53805377

0 commit comments

Comments
 (0)