================
@@ -12917,6 +12917,14 @@ bool Sema::CheckForConstantInitializer(Expr *Init, 
unsigned DiagID) {
   if (Init->isConstantInitializer(Context, /*ForRef=*/false, &Culprit))
     return false;
 
+  // Under ARC, the initializer is wrapped in `ExprWithCleanups` +
+  // `ImplicitCastExpr <ARCReclaimReturnedObject>`. Unwrap both
+  // here so the ObjC-specific path fires under ARC too.
+  Init = Init->IgnoreImpCasts();
----------------
AaronBallman wrote:

Are we sure it's safe to ignore all implicit casts? e.g., non-atomic to atomic, 
or address space conversions, etc

I'm a bit worried there's a case which *should* be non-constant because of that 
conversion, but these changes only impact Objective-C literals and I have far 
less knowledge about those.

https://github.com/llvm/llvm-project/pull/209688
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to