CK_Dynamic,
/// CK_ToUnion - Cast to union (GCC extension).
- CK_ToUnion
+ CK_ToUnion,
+
+ /// CK_ArrayToPointerDecay - Array to pointer decay.
+ CK_ArrayToPointerDecay
};
private:
// If this is due to array->pointer conversion, emit the array expression as
// an l-value.
if (Op->getType()->isArrayType()) {
+ assert(E->getCastKind() == CastExpr::CK_ArrayToPointerDecay);
Value *V = EmitLValue(Op).getAddress(); // Bitfields can't be arrays.
// Note that VLA pointers are always decayed, so we don't need to do
//
if (getLangOptions().C99 || getLangOptions().CPlusPlus ||
E->isLvalue(Context) == Expr::LV_Valid)
- ImpCastExprToType(E, Context.getArrayDecayedType(Ty));
+ ImpCastExprToType(E, Context.getArrayDecayedType(Ty),
+ CastExpr::CK_ArrayToPointerDecay);
}
}