[clang] [clang] Load non-simple lvalue operands of __builtin_bit_cast (PR #231830)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 17 14:04:50 PDT 2026


================
@@ -3404,6 +3404,15 @@ void CastOperation::CheckBuiltinBitCast() {
     return;
   }
 
+  if (SrcExpr.get()->isGLValue() &&
----------------
efriedma-quic wrote:

It's worth stepping back to figure out what the goal is here.

If we want to emulate the set of casts that std::bit_cast would perform, we probably don't want to list out special cases like this.  Instead, we should use the same codepath we use for actual arguments, PerformCopyInitialization().  That code already knows how to perform whatever conversions are necessary and diagnose whatever issues come up.

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


More information about the cfe-commits mailing list