[clang] fix explicit incomplete enum (PR #184210)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 2 13:45:57 PST 2026


================
@@ -6464,6 +6464,9 @@ static ExprResult BuildConvertedConstantExpression(Sema &S, Expr *From,
   if (checkPlaceholderForOverload(S, From))
     return ExprError();
 
+  if (From->containsErrors())
+    return S.CreateRecoveryExpr(From->getBeginLoc(), From->getEndLoc(), {From}, T);
----------------
erichkeane wrote:

Yeah, but it creates a valid expression here.  I guess we could instead introduce a cast here for converting the recovery expr, though that seems problematic, doesn't it?  Or at least, a heavy lift.

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


More information about the cfe-commits mailing list