[clang] [C11] Implement WG14 N1285 (temporary lifetimes) (PR #133472)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 31 05:22:55 PDT 2025
================
@@ -741,10 +741,11 @@ ExprResult Sema::ImpCastExprToType(Expr *E, QualType Ty,
if (Kind == CK_ArrayToPointerDecay) {
// C++1z [conv.array]: The temporary materialization conversion is applied.
// We also use this to fuel C++ DR1213, which applies to C++11 onwards.
- if (getLangOpts().CPlusPlus && E->isPRValue()) {
+ if ((getLangOpts().C11 || getLangOpts().CPlusPlus) && E->isPRValue()) {
----------------
AaronBallman wrote:
I thought the change was necessary but you're right, later changes made this dead code.
https://github.com/llvm/llvm-project/pull/133472
More information about the cfe-commits
mailing list