Skip to content

Commit 7452d3c

Browse files
committed
[clang-tidy] fix compilation by disambiguating equality operator
This fixes a compilation issue on Ubuntu 22.04 with the Ubuntu provided Clang 14 and C++20. That's probably happening due to incomplete C++20 support in either Clang 14 or the GNU libstdc++ 12. Signed-off-by: Gregor Jasny <[email protected]>
1 parent 274e798 commit 7452d3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang-tools-extra/clang-tidy/bugprone/TaggedUnionMemberCountCheck.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ TaggedUnionMemberCountCheck::getNumberOfEnumValues(const EnumDecl *ED) {
144144

145145
if (EnableCountingEnumHeuristic && LastEnumConstant &&
146146
isCountingEnumLikeName(LastEnumConstant->getName()) &&
147-
(LastEnumConstant->getInitVal() == (EnumValues.size() - 1))) {
147+
(LastEnumConstant->getInitVal() == llvm::APSInt::getUnsigned(EnumValues.size() - 1u))) {
148148
return {EnumValues.size() - 1, LastEnumConstant};
149149
}
150150

0 commit comments

Comments
 (0)