[Patch] Disallow reinterpret_cast from pointer to bool on Windows (PR16222)

Hans Wennborg hans at chromium.org
Wed Jun 5 06:31:07 PDT 2013


Hi all,

This patch makes Clang disallow reinterpret_cast from pointer to bool
on Windows.

Currently, it's allowed by accident and later triggers an exception.
Support was added in r131201 to allow conversion from pointers to
integral types on windows since this is apparently used in system
headers. However, converting pointers to bool is already supported in
a civilized manner via static_cast and c-style cast. Allowing it
through reinterpret_cast seems like a bad idea.

Please take a look.

Thanks,
Hans
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr16222.diff
Type: application/octet-stream
Size: 1951 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130605/630822c4/attachment.obj>


More information about the cfe-commits mailing list