Re: C++ PATCH for c++/48370 (extending lifetime of temps in aggregate initialization)

2012-08-07 Thread H.J. Lu
On Tue, Jun 12, 2012 at 10:00 PM, H.J. Lu wrote: > On Thu, Nov 3, 2011 at 8:50 PM, Jason Merrill wrote: >> 12.2 states that a temporary bound to a reference lives as long as the >> reference itself. We have done that for reference variables, but not in >> other cases, such as aggregate initializ

Re: C++ PATCH for c++/48370 (extending lifetime of temps in aggregate initialization)

2012-06-12 Thread H.J. Lu
On Thu, Nov 3, 2011 at 8:50 PM, Jason Merrill wrote: > 12.2 states that a temporary bound to a reference lives as long as the > reference itself.  We have done that for reference variables, but not in > other cases, such as aggregate initialization of a struct with reference > members.  In C++11,

Re: C++ PATCH for c++/48370 (extending lifetime of temps in aggregate initialization)

2011-11-07 Thread Jason Merrill
On 11/04/2011 11:23 PM, Jason Merrill wrote: While working on a followup, I noticed that this patch runs temporary cleanups in the wrong order. Fixed (and tested) thus. This patch broke bootstrap because it allocated a gc-able vector and held it across the definition of a function, at the end

Re: C++ PATCH for c++/48370 (extending lifetime of temps in aggregate initialization)

2011-11-04 Thread Jason Merrill
While working on a followup, I noticed that this patch runs temporary cleanups in the wrong order. Fixed (and tested) thus. Tested x86_64-pc-linux-gnu, applying to trunk. commit 376093f30953db1fc7b4537f7ca9253dea91c8a3 Author: Jason Merrill Date: Fri Nov 4 16:32:47 2011 -0400 PR c++/48

C++ PATCH for c++/48370 (extending lifetime of temps in aggregate initialization)

2011-11-03 Thread Jason Merrill
12.2 states that a temporary bound to a reference lives as long as the reference itself. We have done that for reference variables, but not in other cases, such as aggregate initialization of a struct with reference members. In C++11, elements of a std::initializer_list have the same semantic