[cfe-dev] [patch] eliminate noisy warning on MSVC

AlisdairM(public) public at alisdairm.net
Sat Jun 13 08:40:16 PDT 2009


The attached patch eliminates a noisy warning building Clang with Visual
C++.

Essentially, if MSVC sees an operator new overload, it expects to see the
matching operator delete in case an exception is thrown and it needs to
reclaim the storage.  In this case the warning is redundant, as the operator
new overload is declared with an empty throw specification.

I still think it worth taking the patch as:

i/ one forward declaration eliminates around 5500 warnings, totally swamping
signal-to-noise in MSVC.
ii/ it is generally good practice to provide such overloads in pairs, and
I'm more comfortable following the general rule than grokking the code to
see why this is a special case - AFAICT there is no benefit/optimization
from not supplying the overload.

It is also an easy way for me to see how the patch submission process works
;¬)

BTW, among other things I am working on a doc patch for "building Clang on
Windows" which might make MSVC warnings more of an issue (if successful!)

AlisdairM

-------------- next part --------------
A non-text attachment was scrubbed...
Name: MSVCWarning.patch
Type: application/octet-stream
Size: 735 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090613/ef122716/attachment.obj>


More information about the cfe-dev mailing list