[cfe-commits] r131515 - /cfe/trunk/lib/Sema/SemaDeclCXX.cpp

Douglas Gregor dgregor at apple.com
Wed May 18 08:26:33 PDT 2011


On May 17, 2011, at 6:06 PM, Sean Hunt wrote:

> Author: coppro
> Date: Tue May 17 20:06:45 2011
> New Revision: 131515
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=131515&view=rev
> Log:
> Force declaration of implicit members in C++0x mode.
> 
> I hear at least one person crying out in anguish, but it's unfortunately
> necessary to avoid infinite loops with mutually dependent constructors
> trying to call each other and determine if they are deleted.
> 
> It might be possible to go back to the old behavior if we can implement
> part-of-file lookups efficiently, or if a solution is discovered by
> which we can safely detect and avoid infinite recusion.

This is an important optimization, and it is not something we should just give up on. There are a number of issues regarding infinite recursion with implicitly-deleted constructors, and we should seek to find a general solution that does not force us to pessimize the common case (where these computations are simple).

Have you considered computing deletion after overload resolution? For example, OverloadCandidateSet::BestViableFunction() could go ahead and perform the 'deleted' computation when we actually select a constructor as an overload. That way, the declarations can come into being whenever name lookup finds them, but we don't try to decide on their definitions until we've picked them for overload resolution.

	- Doug



More information about the cfe-commits mailing list