This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49528] [4.6 regression] g++ fails to destroy temporary object when subobject is used to initialize a reference
- From: "jason at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 27 Jun 2011 20:17:16 +0000
- Subject: [Bug c++/49528] [4.6 regression] g++ fails to destroy temporary object when subobject is used to initialize a reference
- Auto-submitted: auto-generated
- References: <bug-49528-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49528
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> 2011-06-27 20:16:21 UTC ---
Author: jason
Date: Mon Jun 27 20:16:14 2011
New Revision: 175559
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175559
Log:
PR c++/49528
* semantics.c (potential_constant_expression_1): A TARGET_EXPR
of non-literal type isn't constant.
(cxx_eval_constant_expression): Likewise.
* init.c (expand_default_init): Use maybe_constant_init.
Added:
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/cpp0x/constexpr-cleanup.C
branches/gcc-4_6-branch/gcc/testsuite/g++.dg/init/ref19.C
Modified:
branches/gcc-4_6-branch/gcc/cp/ChangeLog
branches/gcc-4_6-branch/gcc/cp/init.c
branches/gcc-4_6-branch/gcc/cp/semantics.c
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog