On Sep 17, 2012, at 2:03 PM, Rafael Espíndola <[email protected]> 
wrote:

>> The problem here, which I hadn't been thinking about before, is lifetime 
>> extension for temporaries. We actually have to dig into the initializer 
>> expression to find the, even when the variable type is a reference to a 
>> scalar type.
> 
> This patch uses a visitor to find the CXXConstructExpr, but it is not
> clear to me all the cases where we have to stop the AST traverse.

If you check out CGExpr.cpp's EmitExprForReferenceBinding(), it handles all of 
the cases where we can end up extending the lifetime of a temporary. I suggest 
following that, rather than trying to halt an arbitrary RecursiveASTVisitor.

        - Doug
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to