https://github.com/AaronBallman created https://github.com/llvm/llvm-project/pull/151181
This was written out of an abundance of caution because the changes were being added to the release branch. Now we can be a little less cautious and switch to using an assert. No behavioral changes are expected. >From 4ef1f4cb106a253df8e32c83e96f87fb56a88afe Mon Sep 17 00:00:00 2001 From: Aaron Ballman <[email protected]> Date: Tue, 29 Jul 2025 12:09:02 -0400 Subject: [PATCH] Switch sanity check to assert; NFC This was written out of an abundance of caution because the changes were being added to the release branch. Now we can be a little less cautious and switch to using an assert. No behavioral changes are expected. --- clang/lib/AST/ASTStructuralEquivalence.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/clang/lib/AST/ASTStructuralEquivalence.cpp b/clang/lib/AST/ASTStructuralEquivalence.cpp index f113b32d6eb30..52c28a54c3129 100644 --- a/clang/lib/AST/ASTStructuralEquivalence.cpp +++ b/clang/lib/AST/ASTStructuralEquivalence.cpp @@ -884,12 +884,10 @@ static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, // class comparison. if (T1->getTypeClass() == Type::Enum) { T1 = T1->getAs<EnumType>()->getDecl()->getIntegerType(); - if (!T2->isBuiltinType() || T1.isNull()) // Sanity check - return false; + assert(T2->isBuiltinType() && !T1.isNull()); // Sanity check } else if (T2->getTypeClass() == Type::Enum) { T2 = T2->getAs<EnumType>()->getDecl()->getIntegerType(); - if (!T1->isBuiltinType() || T2.isNull()) // Sanity check - return false; + assert(T1->isBuiltinType() && !T2.isNull()); // Sanity check } TC = Type::Builtin; } else _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
