[PATCH] ignore __declspec(novtable) on non-Windows platforms

Bob Wilson bob.wilson at apple.com
Thu Jul 16 17:42:06 PDT 2015


Clang used to silently ignore __declspec(novtable) for all platforms, but it is now implemented for Windows. However, we don’t check if the target is Windows. This does not work when using the Itanium ABI, where the class layout for complex class hierarchies is stored in the vtable. Leaving the vtable uninitialized on non-Windows platforms does not work in that case. It might be possible to honor the novtable attribute in some simple cases and either report an error or ignore it in more complex situations, but it’s not clear if that would be worthwhile. There is also value in having a simple and predictable behavior, so I am proposed the attached patch which simply ignores novtable on non-Windows platforms.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: novtable.patch
Type: application/octet-stream
Size: 1488 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150716/b94c7057/attachment.obj>


More information about the cfe-commits mailing list