[clang] [C11] Implement WG14 N1285 (temporary lifetimes) (PR #133472)
Eli Friedman via cfe-commits
cfe-commits at lists.llvm.org
Fri Mar 28 13:28:59 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()) {
----------------
efriedma-quic wrote:
Does this change actually do anything? I can't come up with any way to produce a prvalue array in C.
https://github.com/llvm/llvm-project/pull/133472
More information about the cfe-commits
mailing list