================ @@ -1028,6 +1045,7 @@ void checkExprLifetime(Sema &SemaRef, const InitializedEntity &Entity, switch (shouldLifetimeExtendThroughPath(Path)) { case PathLifetimeKind::Extend: + assert(InitEntity && "Expect only on initializing the entity"); ---------------- usx95 wrote:
Maybe make it clearer that we do not expect lifetime extension for assignment: "Lifetime extension should happen only for initialization and not assigment". Same below. https://github.com/llvm/llvm-project/pull/96475 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits