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

2024-07-19 Thread via cfe-commits
yronglin wrote: @bgra8 @alexfh Thanks report this issue, I've a new PR to fix it, and added your reproducer into the test. https://github.com/llvm/llvm-project/pull/92527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

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

2024-06-06 Thread via cfe-commits
bgra8 wrote: I reverted this and the dependent patch based on https://github.com/llvm/llvm-project/pull/92527#issuecomment-2149120420 to bring back the repo back to green. https://github.com/llvm/llvm-project/pull/92527 ___ cfe-commits mailing list

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

2024-06-06 Thread via cfe-commits
alexfh wrote: > Here's the reproducer: > > ```c++ > struct a { > virtual int *b(); > }; > template struct d : a { > int *b() { new c; } > }; > int *e(a *); > struct f { > char *g; > }; > struct h {}; > struct i { > i(const f &); > i(h); > }; > struct l { > i j = i({.g = ""}); > }; >

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

2024-06-05 Thread via cfe-commits
bgra8 wrote: Here's the reproducer: ```c++ struct a { virtual int *b(); }; template struct d : a { int *b() { new c; } }; int *e(a *); struct f { char *g; }; struct h {}; struct i { i(const f &); i(h); }; struct l { i j = i({.g = ""}); }; int *k = e(new d); struct n : l {}; int *m =

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

2024-06-03 Thread via cfe-commits
bgra8 wrote: heads-up @yronglin: we've bisected many compilation breakages to this patch. We're working on a reproducer. https://github.com/llvm/llvm-project/pull/92527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

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

2024-05-22 Thread via cfe-commits
https://github.com/yronglin closed https://github.com/llvm/llvm-project/pull/92527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-05-22 Thread via cfe-commits
yronglin wrote: Thanks for the review! https://github.com/llvm/llvm-project/pull/92527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-05-22 Thread via cfe-commits
https://github.com/cor3ntin approved this pull request. https://github.com/llvm/llvm-project/pull/92527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-05-21 Thread Zequan Wu via cfe-commits
@@ -27,6 +27,80 @@ class MemInit { C m = s; }; +namespace std { +typedef decltype(sizeof(int)) size_t; + +// libc++'s implementation +template class initializer_list { + const _E *__begin_; + size_t __size_; + + initializer_list(const _E *__b, size_t __s) : __begin_(__b)

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

2024-05-21 Thread via cfe-commits
yronglin wrote: > I think this looks ok, I'd love it if @cor3ntin took another look, but I'm as > happy as before. Thanks for your review! https://github.com/llvm/llvm-project/pull/92527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https:/

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

2024-05-21 Thread Erich Keane via cfe-commits
https://github.com/erichkeane approved this pull request. I think this looks ok, I'd love it if @cor3ntin took another look, but I'm as happy as before. https://github.com/llvm/llvm-project/pull/92527 ___ cfe-commits mailing list cfe-commits@lists.llv

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

2024-05-20 Thread via cfe-commits
https://github.com/yronglin edited https://github.com/llvm/llvm-project/pull/92527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-05-20 Thread via cfe-commits
@@ -5695,19 +5694,35 @@ ExprResult Sema::BuildCXXDefaultInitExpr(SourceLocation Loc, FieldDecl *Field) { ImmediateCallVisitor V(getASTContext()); if (!NestedDefaultChecking) V.TraverseDecl(Field); - if (V.HasImmediateCalls) { + + // CWG1815 + // Support lifetime ext

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

2024-05-20 Thread Erich Keane via cfe-commits
@@ -5695,19 +5694,35 @@ ExprResult Sema::BuildCXXDefaultInitExpr(SourceLocation Loc, FieldDecl *Field) { ImmediateCallVisitor V(getASTContext()); if (!NestedDefaultChecking) V.TraverseDecl(Field); - if (V.HasImmediateCalls) { + + // CWG1815 + // Support lifetime ext

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

2024-05-20 Thread Erich Keane via cfe-commits
https://github.com/erichkeane edited https://github.com/llvm/llvm-project/pull/92527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2024-05-20 Thread Erich Keane via cfe-commits
https://github.com/erichkeane commented: Not the best one to be reviewing this, but the code generally looks good to me. https://github.com/llvm/llvm-project/pull/92527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-

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

2024-05-20 Thread via cfe-commits
https://github.com/yronglin edited https://github.com/llvm/llvm-project/pull/92527 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits