[clang] [C] Handle comma operator for implicit int->enum conversions (PR #138752)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue May 6 14:25:51 PDT 2025


================
@@ -11647,6 +11647,29 @@ static void DiagnoseFloatingImpCast(Sema &S, Expr *E, QualType T,
   }
 }
 
+static void CheckCommaOperand(Sema &S, Expr *E, QualType T, SourceLocation CC,
+                              bool Check) {
+  E = E->IgnoreParenImpCasts();
+  AnalyzeImplicitConversions(S, E, CC);
+
+  if (Check && E->getType() != T)
----------------
erichkeane wrote:

Curious why the 2nd half of this check?  Is there some problem Checking implicit conversion where no conversion exists?

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


More information about the cfe-commits mailing list