From: Chris Lattner Date: Sat, 13 Jun 2009 20:51:38 +0000 (+0000) Subject: declare an 'operator delete' to match operator new, this avoids many many X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9509108b3dde280dca1999b5c054f5b789581e68;p=clang declare an 'operator delete' to match operator new, this avoids many many 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 --- diff --git a/include/clang/AST/Attr.h b/include/clang/AST/Attr.h index 0427f0003a..a5b7ad4ca3 100644 --- a/include/clang/AST/Attr.h +++ b/include/clang/AST/Attr.h @@ -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.