[PATCH] [libc++abi] Disallow conversions from function pointers to void*.

Richard Smith richard at metafoo.co.uk
Fri Apr 3 17:28:34 PDT 2015


On Fri, Apr 3, 2015 at 5:21 PM, Jonathan Roelofs <jonathan at codesourcery.com>
wrote:

> In http://reviews.llvm.org/D8811#151714, @rsmith wrote:
>
> > What confuses you about that output? The patch says that a pointer type
> whose pointee type is 'void' cannot catch a pointer-to-function; this
> appears to be a correct change to me.
>
>
> I expect that output.
>
> I'm confused by the patch because I don't understand how a thrown
> pointer-to-function could result in `is_equal(__pointee, &typeid(void),
> false))` being true...


The existing code is checking whether the type of the *catch parameter* is
a pointer to void. The new code is checking whether the type of the *thrown
object* is a pointer to function.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150403/1bab0d0d/attachment.html>


More information about the cfe-commits mailing list