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

Sean Hunt scshunt at csclub.uwaterloo.ca
Wed May 18 12:37:26 PDT 2011


On 11-05-18 08:26 AM, Douglas Gregor wrote:
> 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

This has the same problem that the "instantiation" point may have 
additional visible declarations that affect the outcome of the overload 
resolutions performed in the deletion calculations.

I think we also get this catastrophically wrong in the case of templates 
since we can't reasonably perform the deletion check prior to instantiation.

Sean



More information about the cfe-commits mailing list