[clang] [Clang] Add diagnostic when scoped enumeration requires an explicit conversion for binary operations (PR #152698)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 15 06:36:46 PDT 2025
================
@@ -13457,13 +13523,19 @@ inline QualType Sema::CheckLogicalOperands(ExprResult &LHS, ExprResult &RHS,
// C++ [expr.log.or]p1
// The operands are both contextually converted to type bool.
ExprResult LHSRes = PerformContextuallyConvertToBool(LHS.get());
- if (LHSRes.isInvalid())
- return InvalidOperands(Loc, LHS, RHS);
+ if (LHSRes.isInvalid()) {
+ InvalidOperands(Loc, LHS, RHS);
----------------
erichkeane wrote:
I realize it sounds silly (since this function always returns empty qual-type), but can you please save/return the `QualType` from this function call? Looking at history there is an intent to have it 'do more' some day, and this here would end up being a pretty latent/tough to find bug as a result.
https://github.com/llvm/llvm-project/pull/152698
More information about the cfe-commits
mailing list