Skip to content

Commit 659e401

Browse files
committed
[clang-format][NFC] Improve an if conditional in the annotator
1 parent 681d02d commit 659e401

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

clang/lib/Format/TokenAnnotator.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2391,9 +2391,8 @@ class AnnotatingParser {
23912391
return true;
23922392

23932393
// If a (non-string) literal follows, this is likely a cast.
2394-
if (Tok.Next->isNot(tok::string_literal) &&
2395-
(Tok.Next->Tok.isLiteral() ||
2396-
Tok.Next->isOneOf(tok::kw_sizeof, tok::kw_alignof))) {
2394+
if (Tok.Next->isOneOf(tok::kw_sizeof, tok::kw_alignof) ||
2395+
(Tok.Next->Tok.isLiteral() && Tok.Next->isNot(tok::string_literal))) {
23972396
return true;
23982397
}
23992398

0 commit comments

Comments
 (0)