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

via cfe-commits cfe-commits at lists.llvm.org
Fri May 17 04:53:59 PDT 2024


================
@@ -14102,6 +14102,13 @@ TreeTransform<Derived>::TransformCXXTemporaryObjectExpr(
     if (TransformExprs(E->getArgs(), E->getNumArgs(), true, Args,
                        &ArgumentChanged))
       return ExprError();
+
+    if (E->isListInitialization() && !E->isStdInitListInitialization()) {
----------------
yronglin wrote:

If it is list initialization, but the constructor is called, and it is not the case of std::initializer_list, we should recreate an InitListExpr. https://godbolt.org/z/K4rzxosx3

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


More information about the cfe-commits mailing list