[clang] [clang] Fixed a crash when explicitly casting to atomic complex (PR #172163)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 31 09:54:00 PDT 2026


================
@@ -181,21 +183,23 @@ class ComplexExprEmitter
     // here.
     if (E->changesVolatileQualification())
       return EmitLoadOfLValue(E);
-    return EmitCast(E->getCastKind(), E->getSubExpr(), E->getType());
+    return EmitCast(E->getCastKind(), E->getSubExpr(),
+                    E->getType().getAtomicUnqualifiedType());
----------------
efriedma-quic wrote:

This seems like it's adding code in too many places; this is modifying both EmitCast and the callers of EmitCast.

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


More information about the cfe-commits mailing list