[cfe-commits] r74205 - in /cfe/trunk: include/clang/Basic/DiagnosticSemaKinds.td lib/Sema/Sema.h lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaExpr.cpp

Douglas Gregor dgregor at apple.com
Fri Jun 26 09:17:26 PDT 2009


On Jun 26, 2009, at 9:16 AM, Fariborz Jahanian wrote:
> On Jun 26, 2009, at 8:36 AM, Douglas Gregor wrote:
>>
>>> +  AddMemberOperatorCandidates(clang::OO_Equal, SourceLocation(),  
>>> Args, 2,
>>> +                              CandidateSet);
>>> +  OverloadCandidateSet::iterator Best;
>>> +  if (BestViableFunction(CandidateSet,
>>> +                         ClassDecl->getLocation(), Best) ==  
>>> OR_Success)
>>> +    return cast<CXXMethodDecl>(Best->Function);
>>> +  assert(false &&
>>> +         "getAssignOperatorMethod - copy assignment operator  
>>> method not found");
>>> +  return 0;
>>> +}
>>
>> Asserting here is just a temporary measure, right? Because it's  
>> possible for one to find a deleted copy assignment operator (C+ 
>> +0x), and it may also be possible to end up with an ambiguity (but  
>> I can't come up with a test case, so I could be wrong about that).
>
> I am expecting that I always find an unambiguous operator assign  
> here. Since, I alway start the lookup with an implicit assignment
> operator already in place. But, I cannot be sure either. So, let's  
> have this assert in place and see if it exposes a bug in the future.


Okay!

	- Doug



More information about the cfe-commits mailing list