Re: Is escaping of a temp variable valid?

2014-08-18 Thread Richard Biener
On Mon, Aug 18, 2014 at 11:39 AM, Joey Ye wrote: > On Fri, Aug 15, 2014 at 6:33 PM, Richard Biener > wrote: >> On Fri, Aug 15, 2014 at 10:45 AM, Joey Ye wrote: >>> Running into an unexpected result with GCC with following case, but >>> not sure if it is a valid C++ case. >>> >>> #define nullptr

Re: Is escaping of a temp variable valid?

2014-08-18 Thread Joey Ye
On Fri, Aug 15, 2014 at 6:33 PM, Richard Biener wrote: > On Fri, Aug 15, 2014 at 10:45 AM, Joey Ye wrote: >> Running into an unexpected result with GCC with following case, but >> not sure if it is a valid C++ case. >> >> #define nullptr 0 >> enum nonetype { none }; >> >> template >> class class_

Re: Is escaping of a temp variable valid?

2014-08-15 Thread Richard Biener
On Fri, Aug 15, 2014 at 10:45 AM, Joey Ye wrote: > Running into an unexpected result with GCC with following case, but > not sure if it is a valid C++ case. > > #define nullptr 0 > enum nonetype { none }; > > template > class class_zoo { > public: > const T *data; > int length; > > c

Is escaping of a temp variable valid?

2014-08-15 Thread Joey Ye
Running into an unexpected result with GCC with following case, but not sure if it is a valid C++ case. #define nullptr 0 enum nonetype { none }; template class class_zoo { public: const T *data; int length; class_zoo (nonetype) : data (nullptr), length (0) {} class_zoo (const