Skip to content

Commit

Permalink
Expand comparison check to more operators
Browse files Browse the repository at this point in the history
This doesn't actually catch any more real cases in the current code, but
it future-proofs while I'm thinking about such things.
  • Loading branch information
jbytheway committed May 7, 2020
1 parent 44ca15b commit 590c5f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/cata_variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,9 @@ class cata_variant
CATA_VARIANT_OPERATOR( == );
CATA_VARIANT_OPERATOR( != );
CATA_VARIANT_OPERATOR( < ); // NOLINT( cata-use-localized-sorting )
CATA_VARIANT_OPERATOR( <= );
CATA_VARIANT_OPERATOR( > );
CATA_VARIANT_OPERATOR( >= );
CATA_VARIANT_OPERATOR( <= ); // NOLINT( cata-use-localized-sorting )
CATA_VARIANT_OPERATOR( > ); // NOLINT( cata-use-localized-sorting )
CATA_VARIANT_OPERATOR( >= ); // NOLINT( cata-use-localized-sorting )
#undef CATA_VARIANT_OPERATOR
private:
explicit cata_variant( cata_variant_type t, std::string &&v )
Expand Down
7 changes: 6 additions & 1 deletion tools/clang-tidy-plugin/UseLocalizedSortingCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ void UseLocalizedSortingCheck::registerMatchers( MatchFinder *Finder )
0,
expr( hasType( qualType().bind( "arg0Type" ) ) ).bind( "arg0Expr" )
),
hasOverloadedOperatorName( "<" )
anyOf(
hasOverloadedOperatorName( "<" ),
hasOverloadedOperatorName( ">" ),
hasOverloadedOperatorName( "<=" ),
hasOverloadedOperatorName( ">=" )
)
).bind( "opCall" ),
this
);
Expand Down

0 comments on commit 590c5f9

Please sign in to comment.