[clang] Reapply "[Clang][CWG1815] Support lifetime extension of temporary created by aggregate initialization using a default member initializer" (PR #97308)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 5 14:02:36 PDT 2024


================
@@ -6298,6 +6298,15 @@ class Sema final : public SemaBase {
 
   using ImmediateInvocationCandidate = llvm::PointerIntPair<ConstantExpr *, 1>;
 
+  enum class LifetimeExtendingContext {
+    None,       // Not in a lifetime extending context.
+    FlagOnly,   // A flag indicating whether we are in lifetime extending
----------------
shafik wrote:

I find the naming and the descriptions hard to follow.

Maybe `ExtendOnly` and `ExtendAndCollect`? 

I don't think we need to say `A flag` and perhaps a standard reference would help clarify the intent because it feels fuzzy to me reading what is here.

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


More information about the cfe-commits mailing list