Skip to content

Commit

Permalink
[clang-format][NFC] Improve an if conditional in the annotator
Browse files Browse the repository at this point in the history
  • Loading branch information
owenca committed Nov 27, 2023
1 parent 681d02d commit 659e401
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions clang/lib/Format/TokenAnnotator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2391,9 +2391,8 @@ class AnnotatingParser {
return true;

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

Expand Down

0 comments on commit 659e401

Please sign in to comment.