Skip to content

Commit

Permalink
[clang-format][NFC] Minor cleanup of token annotator and test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
owenca committed Sep 11, 2023
1 parent 26f9e49 commit b908123
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion clang/lib/Format/TokenAnnotator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class AnnotatingParser {
bool parseAngle() {
if (!CurrentToken || !CurrentToken->Previous)
return false;
if (NonTemplateLess.count(CurrentToken->Previous))
if (NonTemplateLess.count(CurrentToken->Previous) > 0)
return false;

const FormatToken &Previous = *CurrentToken->Previous; // The '<'.
Expand Down
4 changes: 2 additions & 2 deletions clang/unittests/Format/FormatTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10656,8 +10656,8 @@ TEST_F(FormatTest, UnderstandsTemplateParameters) {
verifyFormat("f(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n"
" .template operator()<A>());",
getLLVMStyleWithColumns(35));
verifyFormat("bool_constant<a && noexcept(f())>");
verifyFormat("bool_constant<a || noexcept(f())>");
verifyFormat("bool_constant<a && noexcept(f())>;");
verifyFormat("bool_constant<a || noexcept(f())>;");

verifyFormat("if (std::tuple_size_v<T> > 0)");

Expand Down

0 comments on commit b908123

Please sign in to comment.