patch: fix odr of pure virtual operator()

Richard Smith richard at
Wed Feb 6 16:17:44 PST 2013

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

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

On Tue, Feb 5, 2013 at 10:48 PM, Nick Lewycky <nlewycky at> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the cfe-commits mailing list