]> granicus.if.org Git - clang/commitdiff
declare an 'operator delete' to match operator new, this avoids many many
authorChris Lattner <sabre@nondot.org>
Sat, 13 Jun 2009 20:51:38 +0000 (20:51 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 13 Jun 2009 20:51:38 +0000 (20:51 +0000)
warnings when building with VC++, patch by AlisdairM!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73305 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Attr.h

index 0427f0003a3a1608420914366ab14f1b89fe25e4..a5b7ad4ca382a8a3351cc5d2bb58d6778d71b1be 100644 (file)
@@ -24,10 +24,16 @@ namespace clang {
 }
 
 
-// Defined in ASTContext.cpp
+// Defined in ASTContext.h
 void *operator new(size_t Bytes, clang::ASTContext &C,
                    size_t Alignment = 16) throw ();
 
+// It is good practice to pair new/delete operators.  Also, MSVC gives many
+// warnings if a matching delete overload is not declared, even though the
+// throw() spec guarantees it will not be implicitly called.
+void operator delete(void *Ptr, clang::ASTContext &C, size_t)
+              throw ();
+
 namespace clang {
 
 /// Attr - This represents one attribute.