patch: fix odr of pure virtual operator()

Nick Lewycky nlewycky at google.com
Wed Feb 6 20:41:40 PST 2013


On 6 February 2013 16:17, Richard Smith <richard at metafoo.co.uk> wrote:

> We seem to have the same issue in CreateOverloadedUnaryOp,
> CreateOverloadedBinOp, CreateOverloadedArraySubscriptExpr, and
> BuildOverloadedArrowExpr.


Right you are.

How about moving the call to MarkFunctionReferenced (and DiagnoseUseOfDecl)
> into CreateFunctionRefExpr, and changing it to call MarkDeclRefReferenced?
>

That works out perfectly. Updated patch attached!

Nick

On Tue, Feb 5, 2013 at 10:48 PM, Nick Lewycky <nlewycky at google.com> wrote:
>
>>  This patch changes Sema::BuildCallToObjectOfClassType to not mark a
>> virtual operator() as odr used when called via functor syntax "(*obj)();".
>> There's no way this syntax can be used to call the body of a pure virtual
>> function. Please review!
>>
>> Nick
>>
>>
>> _______________________________________________
>> cfe-commits mailing list
>> cfe-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130206/08ff6f7d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: odr-pure-4.patch
Type: application/octet-stream
Size: 7962 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130206/08ff6f7d/attachment.obj>


More information about the cfe-commits mailing list