[cfe-dev] [cfe-commits] r169670 - in /cfe/trunk: include/clang/AST/DeclCXX.h lib/AST/DeclCXX.cpp lib/Sema/SemaDeclCXX.cpp

Kim Gräsman kim.grasman at gmail.com
Mon Dec 10 00:35:17 PST 2012


Hi Richard,

On Mon, Dec 10, 2012 at 6:39 AM, Richard Smith <richard at metafoo.co.uk> wrote:
> On Sun, Dec 9, 2012 at 2:12 PM, Kim Gräsman <kim.grasman at gmail.com> wrote:
>> On Sun, Dec 9, 2012 at 11:11 PM, Kim Gräsman <kim.grasman at gmail.com> wrote:
>>>
>>> I think that's equivalent to our previous;
>>>
>>>     if (hasImplicitDeclaredCopyAssignment) {
>>>       something(decl->getCopyAssignmentOperator(true));
>>>       something(decl->getCopyAssignmentOperator(false));
>>>     }
>>
>> ... oh, except it also handles move assignment operators, which is nice.
>
> It also only calls 'something' on the implicit copy assignment operator once :)

The new one, you mean?

I think the old one (above) called 'something' for;

 T& operator=(const T& t);
 T& operator=(T& t);

whereas the new one should call it for any of the below that exist:

 T& operator=(const T& t);
 T& operator=(const volatile T& t);
 T& operator=(T& t);
 T& operator=(volatile T& t);
 T& operator=(T&& t);

I think that preserves the behavior we had and makes it more correct,
even if I'm not entirely sure why this is done. :-/

Thanks,
- Kim




More information about the cfe-dev mailing list