[cfe-dev] Lifetime extension for reference-initializing temporaries

Douglas Gregor dgregor at apple.com
Tue Nov 8 19:13:13 PST 2011


On Nov 5, 2011, at 3:54 AM, Sebastian Redl wrote:

> Hi,
> 
> I can't find the code that extends the lifetime of temporaries that are 
> bound to references. Can someone please help me out?

It's actually implicit in the AST. IR generation deals with this via CGExpr.cpp's EmitExprForReferenceBinding, in particular, where we dig out the destructor for the temporary (which going into the variable ReferenceTemporaryDtor)  after digging through all of the subobject adjustments that may have been applied to the temporary as part of reference binding.

	- Doug



More information about the cfe-dev mailing list