Description
Running clang-tidy with -checks='-*,modernize-use-integer-sign-comparison' and '-std=c++20' (or above) on the code
struct A
{
unsigned size() const;
};
struct B
{
A a;
bool foo(const A& a2) const { return (int)a2.size() == size(); }
int size() const { return (int)a.size(); }
};
triggers an assertion: clang-tidy: /tmp/LLVM/llvm-project/clang-tools-extra/clang-tidy/modernize/UseIntegerSignComparisonCheck.cpp:123: virtual void clang::tidy::modernize::UseIntegerSignComparisonCheck::check(const clang::ast_matchers::MatchFinder::MatchResult&): Assertion 'SignedCastExpression' failed.
This was introduced in the last two weeks, so I suspect this is due to the fix for #127471 .
@RiverDave , @vbvictor : Could you please have a look?