[Bug c++/100838] [11 Regression] -fno-elide-constructors for C++14 missing required destructor call since r11-5872-g4eb28483004f8291

2022-05-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100838

--- Comment #10 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Jason Merrill
:

https://gcc.gnu.org/g:200d477d3cb1593dbaa7739c6270e0a7f6c564cf

commit r9-10178-g200d477d3cb1593dbaa7739c6270e0a7f6c564cf
Author: Jason Merrill 
Date:   Mon May 31 12:36:25 2021 -0400

c++: missing dtor with -fno-elide-constructors [PR100838]

tf_no_cleanup only applies to the outermost TARGET_EXPR, and we already
clear it for nested calls in build_over_call, but in this case both
constructor calls came from convert_like, so we need to clear it in the
recursive call as well.  This revealed that we were adding an extra
ck_rvalue in direct-initialization cases where it was wrong.

PR c++/100838
PR c++/105265

gcc/cp/ChangeLog:

* call.c (convert_like_internal): Clear tf_no_cleanup when
recursing.
(build_user_type_conversion_1): Only add ck_rvalue if
LOOKUP_ONLYCONVERTING.

gcc/testsuite/ChangeLog:

* g++.dg/init/no-elide2.C: New test.
* g++.dg/cpp0x/initlist-new6.C: New test.

[Bug c++/100838] [11 Regression] -fno-elide-constructors for C++14 missing required destructor call since r11-5872-g4eb28483004f8291

2022-05-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100838

--- Comment #9 from CVS Commits  ---
The releases/gcc-10 branch has been updated by Jason Merrill
:

https://gcc.gnu.org/g:67f742536cbb60d5f8b7bba2cac0a141191e29af

commit r10-10727-g67f742536cbb60d5f8b7bba2cac0a141191e29af
Author: Jason Merrill 
Date:   Mon May 31 12:36:25 2021 -0400

c++: missing dtor with -fno-elide-constructors [PR100838]

tf_no_cleanup only applies to the outermost TARGET_EXPR, and we already
clear it for nested calls in build_over_call, but in this case both
constructor calls came from convert_like, so we need to clear it in the
recursive call as well.  This revealed that we were adding an extra
ck_rvalue in direct-initialization cases where it was wrong.

PR c++/100838
PR c++/105265

gcc/cp/ChangeLog:

* call.c (convert_like_internal): Clear tf_no_cleanup when
recursing.
(build_user_type_conversion_1): Only add ck_rvalue if
LOOKUP_ONLYCONVERTING.

gcc/testsuite/ChangeLog:

* g++.dg/init/no-elide2.C: New test.
* g++.dg/cpp0x/initlist-new6.C: New test.

[Bug c++/100838] [11 Regression] -fno-elide-constructors for C++14 missing required destructor call since r11-5872-g4eb28483004f8291

2022-05-12 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100838

--- Comment #8 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Jason Merrill
:

https://gcc.gnu.org/g:728f97cf0431ff342beceea4f91afa1707133248

commit r11-9985-g728f97cf0431ff342beceea4f91afa1707133248
Author: Jason Merrill 
Date:   Wed Apr 13 20:18:33 2022 -0400

c++: temp cleanup in new [PR105265]

The patch for PR100838 in GCC 11 was limited to -fno-elide-constructors for
safety, but this testcase demonstrates that it's also needed without that
flag.  So let's switch to the GCC 12 patch for PR100838.

PR c++/105265
PR c++/100838

gcc/cp/ChangeLog:

* call.c (build_user_type_conversion_1): Drop
flag_elide_constructors check.
(convert_like_internal): Likewise.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/initlist-new6.C: New test.

[Bug c++/100838] [11 Regression] -fno-elide-constructors for C++14 missing required destructor call since r11-5872-g4eb28483004f8291

2022-04-13 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100838

--- Comment #7 from CVS Commits  ---
The master branch has been updated by Jason Merrill :

https://gcc.gnu.org/g:019d6d4149ee97d55ce9efe4e5e470d38130cdeb

commit r12-8149-g019d6d4149ee97d55ce9efe4e5e470d38130cdeb
Author: Jason Merrill 
Date:   Wed Apr 13 12:44:54 2022 -0400

c++: add test [PR105265]

This was fixed by r12-1165, but good to have a test that doesn't need
-fno-elide-constructors.

PR c++/105265
PR c++/100838

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/initlist-new6.C: New test.

[Bug c++/100838] [11 Regression] -fno-elide-constructors for C++14 missing required destructor call since r11-5872-g4eb28483004f8291

2021-07-09 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100838

Jason Merrill  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #6 from Jason Merrill  ---
Fixed for 11.2/12.

[Bug c++/100838] [11 Regression] -fno-elide-constructors for C++14 missing required destructor call since r11-5872-g4eb28483004f8291

2021-07-09 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100838

--- Comment #5 from CVS Commits  ---
The releases/gcc-11 branch has been updated by Jason Merrill
:

https://gcc.gnu.org/g:5830fffacd05463c20b592bb6ed20e333d7d272b

commit r11-8715-g5830fffacd05463c20b592bb6ed20e333d7d272b
Author: Jason Merrill 
Date:   Mon May 31 12:36:25 2021 -0400

c++: missing dtor with -fno-elide-constructors [PR100838]

tf_no_cleanup only applies to the outermost TARGET_EXPR, and we already
clear it for nested calls in build_over_call, but in this case both
constructor calls came from convert_like, so we need to clear it in the
recursive call as well.  This revealed that we were adding an extra
ck_rvalue in direct-initialization cases where it was wrong.

For GCC 11, limit the changes to -fno-elide-constructors.

PR c++/100838

gcc/cp/ChangeLog:

* call.c (convert_like_internal): Clear tf_no_cleanup when
recursing.
(build_user_type_conversion_1): Only add ck_rvalue if
LOOKUP_ONLYCONVERTING.

gcc/testsuite/ChangeLog:

* g++.dg/init/no-elide2.C: New test.

[Bug c++/100838] [11 Regression] -fno-elide-constructors for C++14 missing required destructor call since r11-5872-g4eb28483004f8291

2021-07-06 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100838

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|--- |11.2
   Priority|P3  |P2
  Known to work||12.0
  Known to fail||11.1.0

[Bug c++/100838] [11 Regression] -fno-elide-constructors for C++14 missing required destructor call since r11-5872-g4eb28483004f8291

2021-06-08 Thread jason at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100838

Jason Merrill  changed:

   What|Removed |Added

Summary|[11/12 Regression]  |[11 Regression]
   |-fno-elide-constructors for |-fno-elide-constructors for
   |C++14 missing required  |C++14 missing required
   |destructor call since   |destructor call since
   |r11-5872-g4eb28483004f8291  |r11-5872-g4eb28483004f8291

--- Comment #4 from Jason Merrill  ---
Fixed for 12 so far.