https://github.com/gjasny updated 
https://github.com/llvm/llvm-project/pull/147048

>From 2585b9c7744b04328adb0fc9400665598e995d8e Mon Sep 17 00:00:00 2001
From: Gregor Jasny <gja...@googlemail.com>
Date: Fri, 4 Jul 2025 13:19:22 +0100
Subject: [PATCH] [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 <gja...@googlemail.com>
---
 .../clang-tidy/bugprone/TaggedUnionMemberCountCheck.cpp        | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/clang-tools-extra/clang-tidy/bugprone/TaggedUnionMemberCountCheck.cpp 
b/clang-tools-extra/clang-tidy/bugprone/TaggedUnionMemberCountCheck.cpp
index db0ac281ddfcf..1cb6bd7a3872f 100644
--- a/clang-tools-extra/clang-tidy/bugprone/TaggedUnionMemberCountCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/TaggedUnionMemberCountCheck.cpp
@@ -144,7 +144,8 @@ TaggedUnionMemberCountCheck::getNumberOfEnumValues(const 
EnumDecl *ED) {
 
   if (EnableCountingEnumHeuristic && LastEnumConstant &&
       isCountingEnumLikeName(LastEnumConstant->getName()) &&
-      (LastEnumConstant->getInitVal() == (EnumValues.size() - 1))) {
+      (LastEnumConstant->getInitVal() ==
+       llvm::APSInt::getUnsigned(EnumValues.size() - 1u))) {
     return {EnumValues.size() - 1, LastEnumConstant};
   }
 

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to