[clang] [clang] Don't add built-in operator candidates that can't be viable (PR #227584)

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 30 01:15:50 PDT 2026


================
@@ -9346,6 +9354,12 @@ BuiltinCandidateTypeSet::AddTypesConvertedFrom(QualType Ty,
   HasArithmeticOrEnumeralTypes =
     HasArithmeticOrEnumeralTypes || Ty->isArithmeticType();
 
+  // Flag if the type might convert to a promoted arithmetic or vector type.
+  MayConvertToArithmetic =
+      MayConvertToArithmetic ||
+      !(TyIsRec || Ty->isScopedEnumeralType() || Ty->isAnyPointerType() ||
----------------
zmodem wrote:

Is the `TyIsRec` predicate enough? What about a possible conversion operator, maybe `AllowUserConversions` / `AllowExplicitConversions` should be factored in too?

https://github.com/llvm/llvm-project/pull/227584


More information about the cfe-commits mailing list